Fix "git tag -u" breakage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The recent cleanup to understand

	[user]
		signingkey = ..

sadly broke the old "-u signingkey" syntax. Admittedly the config file 
approach is nicer, and I should probably use it, but even so, there's 
really no reason to break the old syntax either.

Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
---

This fixes it for me, and _looks_ obvious enough, but I didn't actually 
test the other cases (ie tagger name and the config file). Caveat patchor.

diff --git a/git-tag.sh b/git-tag.sh
index 988bf4c..c2c57d5 100755
--- a/git-tag.sh
+++ b/git-tag.sh
@@ -115,6 +115,7 @@ tagger=$(git-var GIT_COMMITTER_IDENT) || exit 1
 
 keyid=$(git-repo-config user.signingkey) ||
 	keyid=$(expr "z$tagger" : 'z\(.*>\)')
+username=${username:-$keyid}
 
 trap 'rm -f "$GIT_DIR"/TAG_TMP* "$GIT_DIR"/TAG_FINALMSG "$GIT_DIR"/TAG_EDITMSG' 0
 
@@ -141,7 +142,7 @@ if [ "$annotate" ]; then
       cat "$GIT_DIR"/TAG_FINALMSG ) >"$GIT_DIR"/TAG_TMP
     rm -f "$GIT_DIR"/TAG_TMP.asc "$GIT_DIR"/TAG_FINALMSG
     if [ "$signed" ]; then
-	gpg -bsa -u "$keyid" "$GIT_DIR"/TAG_TMP &&
+	gpg -bsa -u "$username" "$GIT_DIR"/TAG_TMP &&
 	cat "$GIT_DIR"/TAG_TMP.asc >>"$GIT_DIR"/TAG_TMP ||
 	die "failed to sign the tag with GPG."
     fi
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]