t/lib-diff-alternative: abstract away SHA-1-specific constants
[gitweb.git] / git-rebase--interactive.sh
index ddbd126f2cad0cc68695d12d9d4d9c598075d18a..9947e6265fe7c0bc4531fd928bbf2373a0ae7552 100644 (file)
@@ -285,7 +285,7 @@ pick_one () {
                pick_one_preserving_merges "$@" && return
        output eval git cherry-pick $allow_rerere_autoupdate $allow_empty_message \
                        ${gpg_sign_opt:+$(git rev-parse --sq-quote "$gpg_sign_opt")} \
-                       "$strategy_args" $empty_args $ff "$@"
+                       $signoff "$strategy_args" $empty_args $ff "$@"
 
        # If cherry-pick dies it leaves the to-be-picked commit unrecorded. Reschedule
        # previous task so this commit is not lost.
@@ -524,10 +524,10 @@ do_pick () {
                # resolve before manually running git commit --amend then git
                # rebase --continue.
                git commit --allow-empty --allow-empty-message --amend \
-                          --no-post-rewrite -n -q -C $sha1 &&
+                          --no-post-rewrite -n -q -C $sha1 $signoff &&
                        pick_one -n $sha1 &&
                        git commit --allow-empty --allow-empty-message \
-                                  --amend --no-post-rewrite -n -q -C $sha1 \
+                                  --amend --no-post-rewrite -n -q -C $sha1 $signoff \
                                   ${gpg_sign_opt:+"$gpg_sign_opt"} ||
                                   die_with_patch $sha1 "$(eval_gettext "Could not apply \$sha1... \$rest")"
        else
@@ -961,8 +961,6 @@ git_rebase__interactive () {
        setup_reflog_action
        init_basic_state
 
-       merges_option="--no-merges --cherry-pick"
-
        init_revisions_and_shortrevisions
 
        git rebase--helper --make-script ${keep_empty:+--keep-empty} \
@@ -996,22 +994,16 @@ git_rebase__interactive__preserve_merges () {
                        die "$(gettext "Could not init rewritten commits")"
        fi
 
-       # No cherry-pick because our first pass is to determine
-       # parents to rewrite and skipping dropped commits would
-       # prematurely end our probe
-       merges_option=
-
        init_revisions_and_shortrevisions
 
        format=$(git config --get rebase.instructionFormat)
        # the 'rev-list .. | sed' requires %m to parse; the instruction requires %H to parse
-       git rev-list $merges_option --format="%m%H ${format:-%s}" \
+       git rev-list --format="%m%H ${format:-%s}" \
                --reverse --left-right --topo-order \
                $revisions ${restrict_revision+^$restrict_revision} | \
                sed -n "s/^>//p" |
        while read -r sha1 rest
        do
-
                if test -z "$keep_empty" && is_empty_commit $sha1 && ! is_merge_commit $sha1
                then
                        comment_out="$comment_char "