git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3 9/9] pull: add the --gpg-sign option.

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 3, 2014, 20:31 UTC
Message-ID
<xmqqd2j4djkc.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1391221086-1044384-10-git-send-email-sandals@crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 26 quoted lines
> 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..3b2ea9e 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="$(git rev-parse --sq-quote "-S${1#--gpg-sign=}")"
> +		;;
> +	-S*)
> +		gpg_sign_args="-S${1#-S}"
> +		;;
Interesting.  Remove -S from the beginning and then prefix that with -S?

Also, --gpg-sign='"b m c" <s@c.n>' and -S'"b m c" <s@c.n>' from the command line of this program would result in $gpg_sign_args that are differently quoted. Both of them cannot be correct at the same time.

Show 18 quoted lines
>  	--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"
>  	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
Previous: brian m. carlson
Message 15 of 15 in “add --gpg-sign to rebase and pull”
  1. 0/9 add --gpg-sign to rebase and pullbrian m. carlson, Feb 1, 2014
  2. 1/9 cherry-pick, revert: add the --gpg-sign optionbrian m. carlson, Feb 1, 2014
  3. Junio C HamanoFeb 3, 2014
  4. 2/9 git-sh-setup.sh: add variable to use the stuck-long modebrian m. carlson, Feb 1, 2014
  5. 3/9 am: parse options in stuck-long modebrian m. carlson, Feb 1, 2014
  6. 4/9 am: add the --gpg-sign optionbrian m. carlson, Feb 1, 2014
  7. 5/9 rebase: remove useless arguments checkbrian m. carlson, Feb 1, 2014
  8. 6/9 rebase: don't try to match -M optionbrian m. carlson, Feb 1, 2014
  9. 7/9 rebase: parse options in stuck-long modebrian m. carlson, Feb 1, 2014
  10. 8/9 rebase: add the --gpg-sign optionbrian m. carlson, Feb 1, 2014
  11. Junio C HamanoFeb 3, 2014
  12. brian m. carlsonFeb 7, 2014
  13. Philip OakleyFeb 8, 2014
  14. 9/9 pull: add the --gpg-sign option.brian m. carlson, Feb 1, 2014
  15. Junio C HamanoFeb 3, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.