diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-04-25 13:28:51 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-04-25 13:28:51 +0900 |
commit | 850e9257525ef2fa13e1d34ccce4e6b73085bb4e (patch) | |
tree | 9de3df7ba23ef1db1b95d1a51d98f00ce784711f /git-rebase.sh | |
parent | Merge branch 'pw/rebase-keep-empty-fixes' (diff) | |
parent | rebase --keep-empty: always use interactive rebase (diff) | |
download | tgif-850e9257525ef2fa13e1d34ccce4e6b73085bb4e.tar.xz |
Merge branch 'pw/rebase-signoff'
"git rebase" has learned to honor "--signoff" option when using
backends other than "am" (but not "--preserve-merges").
* pw/rebase-signoff:
rebase --keep-empty: always use interactive rebase
rebase -p: error out if --signoff is given
rebase: extend --signoff support
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-x | git-rebase.sh | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/git-rebase.sh b/git-rebase.sh index 548c15e4a1..ded5de085a 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -93,6 +93,7 @@ preserve_merges= autosquash= keep_empty= allow_empty_message= +signoff= test "$(git config --bool rebase.autosquash)" = "true" && autosquash=t case "$(git config --bool commit.gpgsign)" in true) gpg_sign_opt=-S ;; @@ -122,6 +123,10 @@ read_basic_state () { 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)" + test -f "$state_dir"/signoff && { + signoff="$(cat "$state_dir"/signoff)" + force_rebase=t + } } write_basic_state () { @@ -136,6 +141,7 @@ write_basic_state () { 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 + test -n "$signoff" && echo "$signoff" >"$state_dir"/signoff } output () { @@ -336,7 +342,13 @@ do --ignore-whitespace) git_am_opt="$git_am_opt $1" ;; - --committer-date-is-author-date|--ignore-date|--signoff|--no-signoff) + --signoff) + signoff=--signoff + ;; + --no-signoff) + signoff= + ;; + --committer-date-is-author-date|--ignore-date) git_am_opt="$git_am_opt $1" force_rebase=t ;; @@ -452,6 +464,11 @@ then test -z "$interactive_rebase" && interactive_rebase=implied fi +if test -n "$keep_empty" +then + test -z "$interactive_rebase" && interactive_rebase=implied +fi + if test -n "$interactive_rebase" then type=interactive @@ -470,6 +487,14 @@ then git_format_patch_opt="$git_format_patch_opt --progress" fi +if test -n "$signoff" +then + test -n "$preserve_merges" && + die "$(gettext "error: cannot combine '--signoff' with '--preserve-merges'")" + git_am_opt="$git_am_opt $signoff" + force_rebase=t +fi + if test -z "$rebase_root" then case "$#" in |