From: Junio C Hamano Date: Sat, 27 Jan 2007 06:37:47 GMT Subject: Re: [PATCH] Allow the tag signing key to be specified in the config file Message-ID: <7vodolnfes.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <200701261413.46823.andyparkins@gmail.com> Andy Parkins writes: > This patch adds a configuration entry "user.signingkey" which, if > present, will be passed to the "-u" switch for gpg, allowing the tag > signing key to be overridden. If the entry is not present, the fallback > is the original method, which means existing behaviour will continue > untouched. > diff --git a/git-tag.sh b/git-tag.sh > index 94499c9..01e6526 100755 > --- a/git-tag.sh > +++ b/git-tag.sh > @@ -112,7 +112,11 @@ git-check-ref-format "tags/$name" || > 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 > -: ${username:=$(expr "z$tagger" : 'z\(.*>\)')} > + > +keyid=$(git-repo-config user.signingkey) > +if [ -z "$keyid" ]; then > + : ${keyid:=$(expr "z$tagger" : 'z\(.*>\)')} > +fi Why do you use ": ${parameter:=word}" substitution after having already checked that keyid is empty, I wonder... Am I missing something subtle? Other than that, I think what this patch does makes a lot of sense.