From: Junio C Hamano <gitster@pobox.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: git@vger.kernel.org, Nicolas Vigier <boklm@mars-attacks.org>
Subject: Re: [PATCH v2 9/9] pull: add the --gpg-sign option.
Date: Mon, 27 Jan 2014 15:31:36 -0800 [thread overview]
Message-ID: <xmqqlhy1m27b.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1390524666-51274-10-git-send-email-sandals@crustytoothpaste.net> (brian m. carlson's message of "Fri, 24 Jan 2014 00:51:06 +0000")
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
> git merge already allows us to sign commits, and git rebase has recently
> learned how to do so as well. Teach git pull to parse the -S/--gpg-sign
> option and pass this along to merge or rebase, as appropriate.
>
> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> ---
> git-pull.sh | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/git-pull.sh b/git-pull.sh
> index 0a5aa2c..4164dac 100755
> --- a/git-pull.sh
> +++ b/git-pull.sh
> @@ -138,6 +138,15 @@ do
> --no-verify-signatures)
> verify_signatures=--no-verify-signatures
> ;;
> + --gpg-sign|-S)
> + gpg_sign_args=-S
> + ;;
> + --gpg-sign=*)
> + gpg_sign_args="-S${1#--gpg-sign=}"
> + ;;
Here, $1 is taken from the end-user without any extra quoting...
> + -S*)
> + gpg_sign_args="-S${1#-S}"
> + ;;
> --d|--dr|--dry|--dry-|--dry-r|--dry-ru|--dry-run)
> dry_run=--dry-run
> ;;
> @@ -305,11 +314,13 @@ merge_name=$(git fmt-merge-msg $log_arg <"$GIT_DIR/FETCH_HEAD") || exit
> case "$rebase" in
> true)
> eval="git-rebase $diffstat $strategy_args $merge_args $rebase_args $verbosity"
> + eval="$eval $gpg_sign_args"
... but here it is used as if it is properly quoted so that later
"eval $eval" will take it as a single argument.
git pull --gpg-sign='foo bar'
will probably ask the command to use 'foo' as the signer key id,
with 'bar' as an extra, unknown token on the command line of the
underlying 'git merge', I suspect. A "git rev-parse --sq-quote"
in the earlier hunk may be all it takes to fix it.
Thanks.
> eval="$eval --onto $merge_head ${oldremoteref:-$merge_head}"
> ;;
> *)
> eval="git-merge $diffstat $no_commit $verify_signatures $edit $squash $no_ff $ff_only"
> - eval="$eval $log_arg $strategy_args $merge_args $verbosity $progress"
> + eval="$eval $log_arg $strategy_args $merge_args $verbosity $progress"
> + eval="$eval $gpg_sign_args"
> eval="$eval \"\$merge_name\" HEAD $merge_head"
> ;;
> esac
next prev parent reply other threads:[~2014-01-27 23:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-24 0:50 [PATCH v2 0/9] add --gpg-sign to rebase and pull brian m. carlson
2014-01-24 0:50 ` [PATCH v2 1/9] cherry-pick, revert: add the --gpg-sign option brian m. carlson
2014-01-24 21:00 ` Junio C Hamano
2014-01-24 21:08 ` brian m. carlson
2014-01-24 22:45 ` Junio C Hamano
2014-01-24 0:50 ` [PATCH v2 2/9] git-sh-setup.sh: add variable to use the stuck-long mode brian m. carlson
2014-01-27 23:21 ` Junio C Hamano
2014-01-24 0:51 ` [PATCH v2 3/9] am: parse options in " brian m. carlson
2014-01-24 0:51 ` [PATCH v2 4/9] am: add the --gpg-sign option brian m. carlson
2014-01-27 23:26 ` Junio C Hamano
2014-01-24 0:51 ` [PATCH v2 5/9] rebase: remove useless arguments check brian m. carlson
2014-01-24 0:51 ` [PATCH v2 6/9] rebase: don't try to match -M option brian m. carlson
2014-01-24 0:51 ` [PATCH v2 7/9] rebase: parse options in stuck-long mode brian m. carlson
2014-01-24 0:51 ` [PATCH v2 8/9] rebase: add the --gpg-sign option brian m. carlson
2014-01-27 23:36 ` Junio C Hamano
2014-01-27 23:59 ` brian m. carlson
2014-01-24 0:51 ` [PATCH v2 9/9] pull: " brian m. carlson
2014-01-27 23:31 ` Junio C Hamano [this message]
2014-02-01 1:01 ` brian m. carlson
2014-02-03 18:04 ` Junio C Hamano
2014-01-24 9:14 ` [PATCH v2 0/9] add --gpg-sign to rebase and pull Nicolas Vigier
2014-01-24 20:06 ` Junio C Hamano
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=xmqqlhy1m27b.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=boklm@mars-attacks.org \
--cc=git@vger.kernel.org \
--cc=sandals@crustytoothpaste.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.