{"thread":{"id":"6588","subject":"Fix \"git tag -u\" breakage","startedAt":"2007-01-31T04:00:22Z","lastAt":"2007-01-31T08:37:58Z","messageCount":3,"participants":["Linus Torvalds","Junio C Hamano","Andy Parkins"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"33106","messageId":"Pine.LNX.4.64.0701301957320.3611@woody.linux-foundation.org","threadId":"6588","inReplyTo":null,"subject":"Fix \"git tag -u\" breakage","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-01-31T04:00:22Z","receivedAt":"2007-01-31T04:00:22Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nThe recent cleanup to understand\n\n\t[user]\n\t\tsigningkey = ..\n\nsadly broke the old \"-u signingkey\" syntax. Admittedly the config file \napproach is nicer, and I should probably use it, but even so, there's \nreally no reason to break the old syntax either.\n\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\n---\n\nThis fixes it for me, and _looks_ obvious enough, but I didn't actually \ntest the other cases (ie tagger name and the config file). Caveat patchor.\n\ndiff --git a/git-tag.sh b/git-tag.sh\nindex 988bf4c..c2c57d5 100755\n--- a/git-tag.sh\n+++ b/git-tag.sh\n@@ -115,6 +115,7 @@ tagger=$(git-var GIT_COMMITTER_IDENT) || exit 1\n \n keyid=$(git-repo-config user.signingkey) ||\n \tkeyid=$(expr \"z$tagger\" : 'z\\(.*>\\)')\n+username=${username:-$keyid}\n \n trap 'rm -f \"$GIT_DIR\"/TAG_TMP* \"$GIT_DIR\"/TAG_FINALMSG \"$GIT_DIR\"/TAG_EDITMSG' 0\n \n@@ -141,7 +142,7 @@ if [ \"$annotate\" ]; then\n       cat \"$GIT_DIR\"/TAG_FINALMSG ) >\"$GIT_DIR\"/TAG_TMP\n     rm -f \"$GIT_DIR\"/TAG_TMP.asc \"$GIT_DIR\"/TAG_FINALMSG\n     if [ \"$signed\" ]; then\n-\tgpg -bsa -u \"$keyid\" \"$GIT_DIR\"/TAG_TMP &&\n+\tgpg -bsa -u \"$username\" \"$GIT_DIR\"/TAG_TMP &&\n \tcat \"$GIT_DIR\"/TAG_TMP.asc >>\"$GIT_DIR\"/TAG_TMP ||\n \tdie \"failed to sign the tag with GPG.\"\n     fi\n"},{"id":"33108","messageId":"7vsldrx08q.fsf@assigned-by-dhcp.cox.net","threadId":"6588","inReplyTo":"Pine.LNX.4.64.0701301957320.3611@woody.linux-foundation.org","subject":"Re: Fix \"git tag -u\" breakage","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-31T04:56:37Z","receivedAt":"2007-01-31T04:56:37Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@linux-foundation.org> writes:\n\n> The recent cleanup to understand\n>\n> \t[user]\n> \t\tsigningkey = ..\n>\n> sadly broke the old \"-u signingkey\" syntax. Admittedly the config file \n> approach is nicer, and I should probably use it, but even so, there's \n> really no reason to break the old syntax either.\n>\n> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>\n> ---\n>\n> This fixes it for me, and _looks_ obvious enough, but I didn't actually \n> test the other cases (ie tagger name and the config file). Caveat patchor.\n\nSorry, and thanks.\n\nThere was no reason to introduce a separate variable keyid to\nbegin with.  I should have been more careful to read what was\noutside of the patch.\n\ndiff --git a/git-tag.sh b/git-tag.sh\nindex 988bf4c..4a0a7b6 100755\n--- a/git-tag.sh\n+++ b/git-tag.sh\n@@ -113,8 +113,9 @@ object=$(git-rev-parse --verify --default HEAD \"$@\") || exit 1\n type=$(git-cat-file -t $object) || exit 1\n tagger=$(git-var GIT_COMMITTER_IDENT) || exit 1\n \n-keyid=$(git-repo-config user.signingkey) ||\n-\tkeyid=$(expr \"z$tagger\" : 'z\\(.*>\\)')\n+test -n \"$username\" ||\n+\tusername=$(git-repo-config user.signingkey) ||\n+\tusername=$(expr \"z$tagger\" : 'z\\(.*>\\)')\n \n trap 'rm -f \"$GIT_DIR\"/TAG_TMP* \"$GIT_DIR\"/TAG_FINALMSG \"$GIT_DIR\"/TAG_EDITMSG' 0\n \n@@ -141,7 +142,7 @@ if [ \"$annotate\" ]; then\n       cat \"$GIT_DIR\"/TAG_FINALMSG ) >\"$GIT_DIR\"/TAG_TMP\n     rm -f \"$GIT_DIR\"/TAG_TMP.asc \"$GIT_DIR\"/TAG_FINALMSG\n     if [ \"$signed\" ]; then\n-\tgpg -bsa -u \"$keyid\" \"$GIT_DIR\"/TAG_TMP &&\n+\tgpg -bsa -u \"$username\" \"$GIT_DIR\"/TAG_TMP &&\n \tcat \"$GIT_DIR\"/TAG_TMP.asc >>\"$GIT_DIR\"/TAG_TMP ||\n \tdie \"failed to sign the tag with GPG.\"\n     fi\n"},{"id":"33115","messageId":"200701310838.01295.andyparkins@gmail.com","threadId":"6588","inReplyTo":"7vsldrx08q.fsf@assigned-by-dhcp.cox.net","subject":"Re: Fix \"git tag -u\" breakage","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-01-31T08:37:58Z","receivedAt":"2007-01-31T08:37:58Z","isPatch":false,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Wednesday 2007 January 31 04:56, Junio C Hamano wrote:\n\n> Sorry, and thanks.\n\nApologies - I thought I had searched for all instances of username in the \nscript.  Perhaps I just looked for $username.  Duh.\n\n> There was no reason to introduce a separate variable keyid to\n> begin with.  I should have been more careful to read what was\n> outside of the patch.\n\nThe change of name was to indicate that the variable isn't actually holding a \nusername anymore, it really is a key ID.  GPG will let you specify a key in a \nnumber of ways, only one of which is by username.  Therefore, I think a \nbetter patch would be to finish what I started and change the remaining two \ninstances of username to keyid.\n\ndiff --git a/git-tag.sh b/git-tag.sh\nindex 988bf4c..0898a70 100755\n--- a/git-tag.sh\n+++ b/git-tag.sh\n@@ -10,7 +10,7 @@ annotate=\n signed=\n force=\n message=\n-username=\n+keyid=\n list=\n verify=\n while case \"$#\" in 0) break ;; esac\n@@ -59,7 +59,7 @@ do\n    annotate=1\n    signed=1\n    shift\n-   username=\"$1\"\n+   keyid=\"$1\"\n    ;;\n     -d)\n        shift\n\n\n\nAndy\n\n-- \nDr Andy Parkins, M Eng (hons), MIEE\nandyparkins@gmail.com\n"}]}