summaryrefslogtreecommitdiff
path: root/git-pull.sh
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2014-02-10 01:03:38 +0000
committerJunio C Hamano <gitster@pobox.com>2014-02-11 14:52:08 -0800
commitea230d8b626d48a5b7851d84f75dd6708479cb59 (patch)
tree9f2072b90698d35027a07cd114b731eb3f32bd0d /git-pull.sh
parent3ee5e54038fd32ee60b24ebd385981aeb14b80a5 (diff)
downloadgit-ea230d8b626d48a5b7851d84f75dd6708479cb59.tar.gz
pull: add the --gpg-sign option.bc/gpg-sign-everywhere
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-pull.sh')
-rwxr-xr-xgit-pull.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/git-pull.sh b/git-pull.sh
index 0a5aa2c821..6986e0fdfb 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=$(git rev-parse --sq-quote "$1")
+ ;;
--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