diff --git a/scripts/update-patches.sh b/scripts/update-patches.sh
index 47457317a36d3783fc6fead7684ea89f279f5eab..c4c0b53c1b170813226c97ec9df9a290020e9d5b 100755
--- a/scripts/update-patches.sh
+++ b/scripts/update-patches.sh
@@ -13,6 +13,6 @@ for module in $GLUON_MODULES; do
 	n=0
 	for commit in $(git -C "$dir" rev-list --reverse --no-merges base..patched); do
 		let n=n+1
-		git -C "$dir" show --pretty=format:'From: %an <%ae>%nDate: %aD%nSubject: %B' $commit > "$1"/patches/$module/"$(printf '%04u' $n)-$(git -C "$dir" show -s --pretty=format:%f).patch"
+		git -C "$dir" show --pretty=format:'From: %an <%ae>%nDate: %aD%nSubject: %B' $commit > "$1"/patches/$module/"$(printf '%04u' $n)-$(git -C "$dir" show -s --pretty=format:%f $commit).patch"
 	done
 done