Re: [PATCH] Allow the tag signing key to be specified in the config file
- From
Junio C Hamano <junkio@cox.net>
- Date
- Jan 27, 2007, 06:37 UTC
- Message-ID
- <7vodolnfes.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <200701261413.46823.andyparkins@gmail.com>
Andy Parkins <andyparkins@gmail.com> writes:
Show 5 quoted lines
> 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.
Show 14 quoted lines
> 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\(.*>\)')}
> +fiWhy 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.