Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-04-25 07:28:51 +0300
committerJunio C Hamano <gitster@pobox.com>2018-04-25 07:28:51 +0300
commit850e9257525ef2fa13e1d34ccce4e6b73085bb4e (patch)
tree9de3df7ba23ef1db1b95d1a51d98f00ce784711f /git-rebase.sh
parentd892beef52a293b271538481dbc76014672ddf09 (diff)
parentda27a6fbd50861149b32cfd1f9e5c36a935c575a (diff)
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-xgit-rebase.sh27
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