]> git.ipfire.org Git - thirdparty/git.git/commitdiff
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

18 files changed:
Documentation/git-am.txt
Documentation/git-cherry-pick.txt
Documentation/git-rebase.txt
Documentation/git-revert.txt
builtin/revert.c
contrib/git-resurrect.sh
git-am.sh
git-instaweb.sh
git-pull.sh
git-quiltimport.sh
git-rebase--am.sh
git-rebase--interactive.sh
git-rebase--merge.sh
git-rebase.sh
git-request-pull.sh
git-sh-setup.sh
sequencer.c
sequencer.h

index 54d8461d61b2f2ad5dbf5ce8c9106534d1a74289..17924d0f3ff3cf525b5ab93b50020929d6ea24c0 100644 (file)
@@ -14,7 +14,7 @@ SYNOPSIS
         [--ignore-date] [--ignore-space-change | --ignore-whitespace]
         [--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]
         [--exclude=<path>] [--include=<path>] [--reject] [-q | --quiet]
-        [--[no-]scissors]
+        [--[no-]scissors] [-S[<keyid>]]
         [(<mbox> | <Maildir>)...]
 'git am' (--continue | --skip | --abort)
 
@@ -119,6 +119,10 @@ default.   You can use `--no-utf8` to override this.
        Skip the current patch.  This is only meaningful when
        restarting an aborted patch.
 
+-S[<keyid>]::
+--gpg-sign[=<keyid>]::
+       GPG-sign commits.
+
 --continue::
 -r::
 --resolved::
index c205d2363e426ed6b1a91df2b8d9b4a3c576a5ea..f1e6b2fd6d15809f5180fe705c3d571bf247ff1d 100644 (file)
@@ -8,7 +8,8 @@ git-cherry-pick - Apply the changes introduced by some existing commits
 SYNOPSIS
 --------
 [verse]
-'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] [--ff] <commit>...
+'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] [--ff]
+                 [-S[<keyid>]] <commit>...
 'git cherry-pick' --continue
 'git cherry-pick' --quit
 'git cherry-pick' --abort
@@ -100,6 +101,10 @@ effect to your index in a row.
 --signoff::
        Add Signed-off-by line at the end of the commit message.
 
+-S[<keyid>]::
+--gpg-sign[=<keyid>]::
+       GPG-sign commits.
+
 --ff::
        If the current HEAD is the same as the parent of the
        cherry-pick'ed commit, then a fast forward to this commit will
index 2889be6bdc4a1a243585e43def2e7416a9aa7038..2a93c645bdb62c28ac9315659b794aa1d3932a4b 100644 (file)
@@ -281,6 +281,10 @@ which makes little sense.
        specified, `-s recursive`.  Note the reversal of 'ours' and
        'theirs' as noted above for the `-m` option.
 
+-S[<keyid>]::
+--gpg-sign[=<keyid>]::
+       GPG-sign commits.
+
 -q::
 --quiet::
        Be quiet. Implies --no-stat.
index 2de67a54962b2f04f1f497344286fd17918433f3..9eb83f01a4513ae3503258067133cae99189d39e 100644 (file)
@@ -8,7 +8,7 @@ git-revert - Revert some existing commits
 SYNOPSIS
 --------
 [verse]
-'git revert' [--[no-]edit] [-n] [-m parent-number] [-s] <commit>...
+'git revert' [--[no-]edit] [-n] [-m parent-number] [-s] [-S[<keyid>]] <commit>...
 'git revert' --continue
 'git revert' --quit
 'git revert' --abort
@@ -80,6 +80,10 @@ more details.
 This is useful when reverting more than one commits'
 effect to your index in a row.
 
+-S[<keyid>]::
+--gpg-sign[=<keyid>]::
+       GPG-sign commits.
+
 -s::
 --signoff::
        Add Signed-off-by line at the end of the commit message.
index 87659c9fdb749bf8cbf33ce71391fdfe284edd6d..065d88dd05ea65d6e53e617417555399920f8afd 100644 (file)
@@ -89,6 +89,8 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)
                OPT_STRING(0, "strategy", &opts->strategy, N_("strategy"), N_("merge strategy")),
                OPT_CALLBACK('X', "strategy-option", &opts, N_("option"),
                        N_("option for merge strategy"), option_parse_x),
+               { OPTION_STRING, 'S', "gpg-sign", &opts->gpg_sign, N_("key id"),
+                 N_("GPG sign commit"), PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
                OPT_END(),
                OPT_END(),
                OPT_END(),
index a4ed4c3c62f0d5abcee36000a6c3a8f43dc02112..d7e97bbc76c27f61e83a5328831fd6889b22e662 100755 (executable)
@@ -10,6 +10,7 @@ is rather slow but allows you to resurrect other people's topic
 branches."
 
 OPTIONS_KEEPDASHDASH=
+OPTIONS_STUCKLONG=
 OPTIONS_SPEC="\
 git resurrect $USAGE
 --
index bbea43075be030c272ef0d8e4cb9c25a179d4e53..78517f254f7e772145ff419bb3f000507458ff60 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -4,6 +4,7 @@
 
 SUBDIRECTORY_OK=Yes
 OPTIONS_KEEPDASHDASH=
+OPTIONS_STUCKLONG=t
 OPTIONS_SPEC="\
 git am [options] [(<mbox>|<Maildir>)...]
 git am [options] (--continue | --skip | --abort)
@@ -37,6 +38,7 @@ abort           restore the original branch and abort the patching operation.
 committer-date-is-author-date    lie about committer date
 ignore-date     use current timestamp for author date
 rerere-autoupdate update the index with reused conflict resolution if possible
+S,gpg-sign?     GPG-sign commits
 rebasing*       (internal use for git-rebase)"
 
 . git-sh-setup
@@ -374,6 +376,7 @@ git_apply_opt=
 committer_date_is_author_date=
 ignore_date=
 allow_rerere_autoupdate=
+gpg_sign_opt=
 
 if test "$(git config --bool --get am.keepcr)" = true
 then
@@ -413,14 +416,14 @@ it will be removed. Please do not use it anymore."
                abort=t ;;
        --rebasing)
                rebasing=t threeway=t ;;
-       --resolvemsg)
-               shift; resolvemsg=$1 ;;
-       --whitespace|--directory|--exclude|--include)
-               git_apply_opt="$git_apply_opt $(sq "$1=$2")"; shift ;;
-       -C|-p)
-               git_apply_opt="$git_apply_opt $(sq "$1$2")"; shift ;;
-       --patch-format)
-               shift ; patch_format="$1" ;;
+       --resolvemsg=*)
+               resolvemsg="${1#--resolvemsg=}" ;;
+       --whitespace=*|--directory=*|--exclude=*|--include=*)
+               git_apply_opt="$git_apply_opt $(sq "$1")" ;;
+       -C*|-p*)
+               git_apply_opt="$git_apply_opt $(sq "$1")" ;;
+       --patch-format=*)
+               patch_format="${1#--patch-format=}" ;;
        --reject|--ignore-whitespace|--ignore-space-change)
                git_apply_opt="$git_apply_opt $1" ;;
        --committer-date-is-author-date)
@@ -435,6 +438,10 @@ it will be removed. Please do not use it anymore."
                keepcr=t ;;
        --no-keep-cr)
                keepcr=f ;;
+       --gpg-sign)
+               gpg_sign_opt=-S ;;
+       --gpg-sign=*)
+               gpg_sign_opt="-S${1#--gpg-sign=}" ;;
        --)
                shift; break ;;
        *)
@@ -899,7 +906,8 @@ did you forget to use 'git add'?"
                        GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
                        export GIT_COMMITTER_DATE
                fi &&
-               git commit-tree $tree ${parent:+-p} $parent <"$dotest/final-commit"
+               git commit-tree ${parent:+-p} $parent ${gpg_sign_opt:+"$gpg_sign_opt"} $tree  \
+                       <"$dotest/final-commit"
        ) &&
        git update-ref -m "$GIT_REFLOG_ACTION: $FIRSTLINE" HEAD $commit $parent ||
        stop_here $this
index e93a2386754342ce759b568fc360488119c09a2d..4aa3eb80fd25a803d291631965d009a49cfe79dc 100755 (executable)
@@ -5,6 +5,7 @@
 
 PERL='@@PERL@@'
 OPTIONS_KEEPDASHDASH=
+OPTIONS_STUCKLONG=
 OPTIONS_SPEC="\
 git instaweb [options] (--start | --stop | --restart)
 --
index def7cc0e235248bdd023c9bd2c980e5c06a02204..6cd8ebc534c174dfe613f62047424dc7491d75fa 100755 (executable)
@@ -153,6 +153,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
                ;;
@@ -320,11 +329,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
index 8e17525dd86aa614000d9b335f9671a829678901..167d79fea809b918e81c2228ee27baa5fab23db4 100755 (executable)
@@ -1,5 +1,6 @@
 #!/bin/sh
 OPTIONS_KEEPDASHDASH=
+OPTIONS_STUCKLONG=
 OPTIONS_SPEC="\
 git quiltimport [options]
 --
index a4f683a5d70213151f3713cc0a2d76dfe8293fd3..df46f4ca9629253238e94ae31ae26c77b452dde3 100644 (file)
@@ -6,7 +6,8 @@
 
 case "$action" in
 continue)
-       git am --resolved --resolvemsg="$resolvemsg" &&
+       git am --resolved --resolvemsg="$resolvemsg" \
+               ${gpg_sign_opt:+"$gpg_sign_opt"} &&
        move_to_original_branch
        return
        ;;
@@ -26,7 +27,7 @@ then
        # empty commits and even if it didn't the format doesn't really lend
        # itself well to recording empty patches.  fortunately, cherry-pick
        # makes this easy
-       git cherry-pick --allow-empty "$revisions"
+       git cherry-pick ${gpg_sign_opt:+"$gpg_sign_opt"} --allow-empty "$revisions"
        ret=$?
 else
        rm -f "$GIT_DIR/rebased-patches"
@@ -60,7 +61,8 @@ else
                return $?
        fi
 
-       git am $git_am_opt --rebasing --resolvemsg="$resolvemsg" <"$GIT_DIR/rebased-patches"
+       git am $git_am_opt --rebasing --resolvemsg="$resolvemsg" \
+               ${gpg_sign_opt:+"$gpg_sign_opt"} <"$GIT_DIR/rebased-patches"
        ret=$?
 
        rm -f "$GIT_DIR/rebased-patches"
index 43c19e0829ca727501ba7e4d29c952bc286ccb77..a1adae83131b5918ec6f994043f3f3ccd3b8c3d8 100644 (file)
@@ -179,9 +179,10 @@ exit_with_patch () {
        echo "$1" > "$state_dir"/stopped-sha
        make_patch $1
        git rev-parse --verify HEAD > "$amend"
+       gpg_sign_opt_quoted=${gpg_sign_opt:+$(git rev-parse --sq-quote "$gpg_sign_opt")}
        warn "You can amend the commit now, with"
        warn
-       warn "  git commit --amend"
+       warn "  git commit --amend $gpg_sign_opt_quoted"
        warn
        warn "Once you are satisfied with your changes, run"
        warn
@@ -248,7 +249,9 @@ pick_one () {
 
        test -d "$rewritten" &&
                pick_one_preserving_merges "$@" && return
-       output eval git cherry-pick "$strategy_args" $empty_args $ff "$@"
+       output eval git cherry-pick \
+                       ${gpg_sign_opt:+$(git rev-parse --sq-quote "$gpg_sign_opt")} \
+                       "$strategy_args" $empty_args $ff "$@"
 }
 
 pick_one_preserving_merges () {
@@ -351,7 +354,8 @@ pick_one_preserving_merges () {
                        new_parents=${new_parents# $first_parent}
                        merge_args="--no-log --no-ff"
                        if ! do_with_author output eval \
-                       'git merge $merge_args $strategy_args -m "$msg_content" $new_parents'
+                       'git merge ${gpg_sign_opt:+"$gpg_sign_opt"} \
+                               $merge_args $strategy_args -m "$msg_content" $new_parents'
                        then
                                printf "%s\n" "$msg_content" > "$GIT_DIR"/MERGE_MSG
                                die_with_patch $sha1 "Error redoing merge $sha1"
@@ -359,7 +363,9 @@ pick_one_preserving_merges () {
                        echo "$sha1 $(git rev-parse HEAD^0)" >> "$rewritten_list"
                        ;;
                *)
-                       output eval git cherry-pick "$strategy_args" "$@" ||
+                       output eval git cherry-pick \
+                               ${gpg_sign_opt:+$(git rev-parse --sq-quote "$gpg_sign_opt")} \
+                               "$strategy_args" "$@" ||
                                die_with_patch $sha1 "Could not pick $sha1"
                        ;;
                esac
@@ -470,7 +476,8 @@ do_pick () {
                           --no-post-rewrite -n -q -C $1 &&
                        pick_one -n $1 &&
                        git commit --allow-empty --allow-empty-message \
-                                  --amend --no-post-rewrite -n -q -C $1 ||
+                                  --amend --no-post-rewrite -n -q -C $1 \
+                                  ${gpg_sign_opt:+"$gpg_sign_opt"} ||
                        die_with_patch $1 "Could not apply $1... $2"
        else
                pick_one $1 ||
@@ -497,7 +504,7 @@ do_next () {
 
                mark_action_done
                do_pick $sha1 "$rest"
-               git commit --amend --no-post-rewrite || {
+               git commit --amend --no-post-rewrite ${gpg_sign_opt:+"$gpg_sign_opt"} || {
                        warn "Could not amend commit after successfully picking $sha1... $rest"
                        warn "This is most likely due to an empty commit message, or the pre-commit hook"
                        warn "failed. If the pre-commit hook failed, you may need to resolve the issue before"
@@ -542,19 +549,22 @@ do_next () {
                squash|s|fixup|f)
                        # This is an intermediate commit; its message will only be
                        # used in case of trouble.  So use the long version:
-                       do_with_author output git commit --amend --no-verify -F "$squash_msg" ||
+                       do_with_author output git commit --amend --no-verify -F "$squash_msg" \
+                               ${gpg_sign_opt:+"$gpg_sign_opt"} ||
                                die_failed_squash $sha1 "$rest"
                        ;;
                *)
                        # This is the final command of this squash/fixup group
                        if test -f "$fixup_msg"
                        then
-                               do_with_author git commit --amend --no-verify -F "$fixup_msg" ||
+                               do_with_author git commit --amend --no-verify -F "$fixup_msg" \
+                                       ${gpg_sign_opt:+"$gpg_sign_opt"} ||
                                        die_failed_squash $sha1 "$rest"
                        else
                                cp "$squash_msg" "$GIT_DIR"/SQUASH_MSG || exit
                                rm -f "$GIT_DIR"/MERGE_MSG
-                               do_with_author git commit --amend --no-verify -F "$GIT_DIR"/SQUASH_MSG -e ||
+                               do_with_author git commit --amend --no-verify -F "$GIT_DIR"/SQUASH_MSG -e \
+                                       ${gpg_sign_opt:+"$gpg_sign_opt"} ||
                                        die_failed_squash $sha1 "$rest"
                        fi
                        rm -f "$squash_msg" "$fixup_msg"
@@ -819,14 +829,15 @@ continue)
        else
                if ! test -f "$author_script"
                then
+                       gpg_sign_opt_quoted=${gpg_sign_opt:+$(git rev-parse --sq-quote "$gpg_sign_opt")}
                        die "You have staged changes in your working tree. If these changes are meant to be
 squashed into the previous commit, run:
 
-  git commit --amend
+  git commit --amend $gpg_sign_opt_quoted
 
 If they are meant to go into a new commit, run:
 
-  git commit
+  git commit $gpg_sign_opt_quoted
 
 In both case, once you're done, continue with:
 
@@ -842,10 +853,12 @@ In both case, once you're done, continue with:
                        die "\
 You have uncommitted changes in your working tree. Please, commit them
 first and then run 'git rebase --continue' again."
-                       do_with_author git commit --amend --no-verify -F "$msg" -e ||
+                       do_with_author git commit --amend --no-verify -F "$msg" -e \
+                               ${gpg_sign_opt:+"$gpg_sign_opt"} ||
                                die "Could not commit staged changes."
                else
-                       do_with_author git commit --no-verify -F "$msg" -e ||
+                       do_with_author git commit --no-verify -F "$msg" -e \
+                               ${gpg_sign_opt:+"$gpg_sign_opt"} ||
                                die "Could not commit staged changes."
                fi
        fi
index e7d96de9adcb133982bbbc6d20cd3b52b3c89214..5381857c59968c38526140d53e3150f19e8d0b0c 100644 (file)
@@ -27,7 +27,7 @@ continue_merge () {
        cmt=`cat "$state_dir/current"`
        if ! git diff-index --quiet --ignore-submodules HEAD --
        then
-               if ! git commit --no-verify -C "$cmt"
+               if ! git commit ${gpg_sign_opt:+"$gpg_sign_opt"} --no-verify -C "$cmt"
                then
                        echo "Commit failed, please do not call \"git commit\""
                        echo "directly, but instead do one of the following: "
index 8a3efa2983d08e38d40ae8b6dcecd82b0901ffa1..5f6732bf3dce78966da1cbb83d4094d584f92598 100755 (executable)
@@ -5,6 +5,7 @@
 
 SUBDIRECTORY_OK=Yes
 OPTIONS_KEEPDASHDASH=
+OPTIONS_STUCKLONG=t
 OPTIONS_SPEC="\
 git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] [<upstream>] [<branch>]
 git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]
@@ -36,6 +37,7 @@ ignore-date!       passed to 'git am'
 whitespace=!       passed to 'git apply'
 ignore-whitespace! passed to 'git apply'
 C=!                passed to 'git apply'
+S,gpg-sign?        GPG-sign commits
  Actions:
 continue!          continue
 abort!             abort and check out the original branch
@@ -84,6 +86,7 @@ preserve_merges=
 autosquash=
 keep_empty=
 test "$(git config --bool rebase.autosquash)" = "true" && autosquash=t
+gpg_sign_opt=
 
 read_basic_state () {
        test -f "$state_dir/head-name" &&
@@ -106,6 +109,8 @@ read_basic_state () {
                strategy_opts="$(cat "$state_dir"/strategy_opts)"
        test -f "$state_dir"/allow_rerere_autoupdate &&
                allow_rerere_autoupdate="$(cat "$state_dir"/allow_rerere_autoupdate)"
+       test -f "$state_dir"/gpg_sign_opt &&
+               gpg_sign_opt="$(cat "$state_dir"/gpg_sign_opt)"
 }
 
 write_basic_state () {
@@ -119,6 +124,7 @@ write_basic_state () {
                "$state_dir"/strategy_opts
        test -n "$allow_rerere_autoupdate" && echo "$allow_rerere_autoupdate" > \
                "$state_dir"/allow_rerere_autoupdate
+       test -n "$gpg_sign_opt" && echo "$gpg_sign_opt" > "$state_dir"/gpg_sign_opt
 }
 
 output () {
@@ -236,23 +242,19 @@ do
                test $total_argc -eq 2 || usage
                action=${1##--}
                ;;
-       --onto)
-               test 2 -le "$#" || usage
-               onto="$2"
-               shift
+       --onto=*)
+               onto="${1#--onto=}"
                ;;
-       -x)
-               test 2 -le "$#" || usage
-               cmd="${cmd}exec $2${LF}"
-               shift
+       --exec=*)
+               cmd="${cmd}exec ${1#--exec=}${LF}"
                ;;
-       -i)
+       --interactive)
                interactive_rebase=explicit
                ;;
-       -k)
+       --keep-empty)
                keep_empty=yes
                ;;
-       -p)
+       --preserve-merges)
                preserve_merges=t
                test -z "$interactive_rebase" && interactive_rebase=implied
                ;;
@@ -268,21 +270,19 @@ do
        --no-fork-point)
                fork_point=
                ;;
-       -M|-m)
+       --merge)
                do_merge=t
                ;;
-       -X)
-               shift
-               strategy_opts="$strategy_opts $(git rev-parse --sq-quote "--$1")"
+       --strategy-option=*)
+               strategy_opts="$strategy_opts $(git rev-parse --sq-quote "--${1#--strategy-option=}")"
                do_merge=t
                test -z "$strategy" && strategy=recursive
                ;;
-       -s)
-               shift
-               strategy="$1"
+       --strategy=*)
+               strategy="${1#--strategy=}"
                do_merge=t
                ;;
-       -n)
+       --no-stat)
                diffstat=
                ;;
        --stat)
@@ -291,21 +291,20 @@ do
        --autostash)
                autostash=true
                ;;
-       -v)
+       --verbose)
                verbose=t
                diffstat=t
                GIT_QUIET=
                ;;
-       -q)
+       --quiet)
                GIT_QUIET=t
                git_am_opt="$git_am_opt -q"
                verbose=
                diffstat=
                ;;
-       --whitespace)
-               shift
-               git_am_opt="$git_am_opt --whitespace=$1"
-               case "$1" in
+       --whitespace=*)
+               git_am_opt="$git_am_opt --whitespace=${1#--whitespace=}"
+               case "${1#--whitespace=}" in
                fix|strip)
                        force_rebase=t
                        ;;
@@ -318,19 +317,24 @@ do
                git_am_opt="$git_am_opt $1"
                force_rebase=t
                ;;
-       -C)
-               shift
-               git_am_opt="$git_am_opt -C$1"
+       -C*)
+               git_am_opt="$git_am_opt $1"
                ;;
        --root)
                rebase_root=t
                ;;
-       -f|--no-ff)
+       --force-rebase|--no-ff)
                force_rebase=t
                ;;
        --rerere-autoupdate|--no-rerere-autoupdate)
                allow_rerere_autoupdate="$1"
                ;;
+       --gpg-sign)
+               gpg_sign_opt=-S
+               ;;
+       --gpg-sign=*)
+               gpg_sign_opt="-S${1#--gpg-sign=}"
+               ;;
        --)
                shift
                break
index fe21d5db631cac88a52d765e5052d4f725aad69e..cf4f1505a54bb6d2fdd580ab7e8186dc8103de49 100755 (executable)
@@ -9,6 +9,7 @@ LONG_USAGE='Summarizes the changes between two commits to the standard output,
 and includes the given URL in the generated summary.'
 SUBDIRECTORY_OK='Yes'
 OPTIONS_KEEPDASHDASH=
+OPTIONS_STUCKLONG=
 OPTIONS_SPEC='git request-pull [options] start url [end]
 --
 p    show patch text as well
index fffa3c72d75961159888fd156614aa6679f3638c..5f28b32dc7ff75830bde919b2f4776f7a9b017e2 100644 (file)
@@ -72,6 +72,8 @@ if test -n "$OPTIONS_SPEC"; then
        parseopt_extra=
        [ -n "$OPTIONS_KEEPDASHDASH" ] &&
                parseopt_extra="--keep-dashdash"
+       [ -n "$OPTIONS_STUCKLONG" ] &&
+               parseopt_extra="$parseopt_extra --stuck-long"
 
        eval "$(
                echo "$OPTIONS_SPEC" |
index 90cac7b02eef1e9f681f5dc58bc26becaaf5ac12..bde5f047b01376e05255a55516d3bdd261f497ea 100644 (file)
@@ -392,11 +392,18 @@ static int run_git_commit(const char *defmsg, struct replay_opts *opts,
 {
        struct argv_array array;
        int rc;
+       char *gpg_sign;
 
        argv_array_init(&array);
        argv_array_push(&array, "commit");
        argv_array_push(&array, "-n");
 
+       if (opts->gpg_sign) {
+               gpg_sign = xmalloc(3 + strlen(opts->gpg_sign));
+               sprintf(gpg_sign, "-S%s", opts->gpg_sign);
+               argv_array_push(&array, gpg_sign);
+               free(gpg_sign);
+       }
        if (opts->signoff)
                argv_array_push(&array, "-s");
        if (!opts->edit) {
@@ -808,6 +815,8 @@ static int populate_opts_cb(const char *key, const char *value, void *data)
                opts->mainline = git_config_int(key, value);
        else if (!strcmp(key, "options.strategy"))
                git_config_string(&opts->strategy, key, value);
+       else if (!strcmp(key, "options.gpg-sign"))
+               git_config_string(&opts->gpg_sign, key, value);
        else if (!strcmp(key, "options.strategy-option")) {
                ALLOC_GROW(opts->xopts, opts->xopts_nr + 1, opts->xopts_alloc);
                opts->xopts[opts->xopts_nr++] = xstrdup(value);
@@ -981,6 +990,8 @@ static void save_opts(struct replay_opts *opts)
        }
        if (opts->strategy)
                git_config_set_in_file(opts_file, "options.strategy", opts->strategy);
+       if (opts->gpg_sign)
+               git_config_set_in_file(opts_file, "options.gpg-sign", opts->gpg_sign);
        if (opts->xopts) {
                int i;
                for (i = 0; i < opts->xopts_nr; i++)
index 1fc22dcabe132cd437e7b0d3c56588c8cd7e63f2..db43e9cf86dcc0914a674adca63303c44e2ccc24 100644 (file)
@@ -37,6 +37,8 @@ struct replay_opts {
 
        int mainline;
 
+       const char *gpg_sign;
+
        /* Merge strategy */
        const char *strategy;
        const char **xopts;