From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: git@vger.kernel.org
Subject: Re: Fix "git tag -u" breakage
Date: Tue, 30 Jan 2007 20:56:37 -0800	[thread overview]
Message-ID: <7vsldrx08q.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0701301957320.3611@woody.linux-foundation.org> (Linus Torvalds's message of "Tue, 30 Jan 2007 20:00:22 -0800 (PST)")
Linus Torvalds <torvalds@linux-foundation.org> writes:
> 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
next prev parent reply	other threads:[~2007-01-31  4:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-31  4:00 Fix "git tag -u" breakage Linus Torvalds
2007-01-31  4:56 ` Junio C Hamano [this message]
2007-01-31  8:37   ` Andy Parkins
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=7vsldrx08q.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).