Merge branch 'bc/gpg-sign-everywhere'
authorJunio C Hamano <gitster@pobox.com>
Thu, 27 Feb 2014 22:01:44 +0000 (14:01 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 27 Feb 2014 22:01:44 +0000 (14:01 -0800)
Teach "--gpg-sign" option to many commands that create commits.

* bc/gpg-sign-everywhere:
pull: add the --gpg-sign option.
rebase: add the --gpg-sign option
rebase: parse options in stuck-long mode
rebase: don't try to match -M option
rebase: remove useless arguments check
am: add the --gpg-sign option
am: parse options in stuck-long mode
git-sh-setup.sh: add variable to use the stuck-long mode
cherry-pick, revert: add the --gpg-sign option

1  2 
git-pull.sh
diff --combined git-pull.sh
index def7cc0e235248bdd023c9bd2c980e5c06a02204,6986e0fdfb9c507938b73afcb2b4e59e44a9a943..6cd8ebc534c174dfe613f62047424dc7491d75fa
@@@ -4,7 -4,7 +4,7 @@@
  #
  # Fetch one or more remote refs and merge it/them into the current HEAD.
  
 -USAGE='[-n | --no-stat] [--[no-]commit] [--[no-]squash] [--[no-]ff] [--[no-]rebase|--rebase=preserve] [-s strategy]... [<fetch-options>] <repo> <head>...'
 +USAGE='[-n | --no-stat] [--[no-]commit] [--[no-]squash] [--[no-]ff|--ff-only] [--[no-]rebase|--rebase=preserve] [-s strategy]... [<fetch-options>] <repo> <head>...'
  LONG_USAGE='Fetch one or more remote refs and integrate it/them with the current HEAD.'
  SUBDIRECTORY_OK=Yes
  OPTIONS_SPEC=
@@@ -52,21 -52,6 +52,21 @@@ if test -z "$rebase
  then
        rebase=$(bool_or_string_config pull.rebase)
  fi
 +
 +# Setup default fast-forward options via `pull.ff`
 +pull_ff=$(git config pull.ff)
 +case "$pull_ff" in
 +false)
 +      no_ff=--no-ff
 +      break
 +      ;;
 +only)
 +      ff_only=--ff-only
 +      break
 +      ;;
 +esac
 +
 +
  dry_run=
  while :
  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=$(git rev-parse --sq-quote "$1")
+               ;;
        --d|--dr|--dry|--dry-|--dry-r|--dry-ru|--dry-run)
                dry_run=--dry-run
                ;;
@@@ -320,11 -314,13 +329,13 @@@ merge_name=$(git fmt-merge-msg $log_ar
  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