git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Fix "git tag -u" breakage

From
Junio C Hamano <junkio@cox.net>
Date
Jan 31, 2007, 04:56 UTC
Message-ID
<7vsldrx08q.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0701301957320.3611@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 14 quoted lines
> 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@linux-foundation.org>
> ---
>
> 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.
Sorry, and thanks.

There was no reason to introduce a separate variable keyid to begin with. I should have been more careful to read what was outside of the patch.

diff --git a/git-tag.sh b/git-tag.sh
index 988bf4c..4a0a7b6 100755
--- a/git-tag.sh
+++ b/git-tag.sh
@@ -113,8 +113,9 @@ object=$(git-rev-parse --verify --default HEAD "$@") || exit 1
 type=$(git-cat-file -t $object) || exit 1
 tagger=$(git-var GIT_COMMITTER_IDENT) || exit 1
 
-keyid=$(git-repo-config user.signingkey) ||
-	keyid=$(expr "z$tagger" : 'z\(.*>\)')
+test -n "$username" ||
+	username=$(git-repo-config user.signingkey) ||
+	username=$(expr "z$tagger" : 'z\(.*>\)')
 
 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
Previous: Linus TorvaldsNext: Andy Parkins
Message 2 of 3 in “Fix "git tag -u" breakage”
  1. Linus TorvaldsJan 31, 2007
  2. Junio C HamanoJan 31, 2007
  3. Andy ParkinsJan 31, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.