|
1 |
| -# This shell script fragment is sourced by git-rebase to implement |
2 |
| -# its interactive mode. "git rebase --interactive" makes it easy |
3 |
| -# to fix up commits in the middle of a series and rearrange commits. |
| 1 | +# This shell script fragment is sourced by git-rebase to implement its |
| 2 | +# preserve-merges mode. |
4 | 3 | #
|
5 | 4 | # Copyright (c) 2006 Johannes E. Schindelin
|
6 | 5 | #
|
7 |
| -# The original idea comes from Eric W. Biederman, in |
8 |
| -# https://public-inbox.org/git/[email protected]/ |
9 |
| -# |
10 | 6 | # The file containing rebase commands, comments, and empty lines.
|
11 | 7 | # This file is created by "git rebase -i" then edited by the user. As
|
12 | 8 | # the lines are processed, they are removed from the front of this
|
@@ -287,17 +283,7 @@ pick_one () {
|
287 | 283 | empty_args="--allow-empty"
|
288 | 284 | fi
|
289 | 285 |
|
290 |
| - test -d "$rewritten" && |
291 |
| - pick_one_preserving_merges "$@" && return |
292 |
| - output eval git cherry-pick $allow_rerere_autoupdate $allow_empty_message \ |
293 |
| - ${gpg_sign_opt:+$(git rev-parse --sq-quote "$gpg_sign_opt")} \ |
294 |
| - $signoff "$strategy_args" $empty_args $ff "$@" |
295 |
| - |
296 |
| - # If cherry-pick dies it leaves the to-be-picked commit unrecorded. Reschedule |
297 |
| - # previous task so this commit is not lost. |
298 |
| - ret=$? |
299 |
| - case "$ret" in [01]) ;; *) reschedule_last_action ;; esac |
300 |
| - return $ret |
| 286 | + pick_one_preserving_merges "$@" |
301 | 287 | }
|
302 | 288 |
|
303 | 289 | pick_one_preserving_merges () {
|
@@ -761,11 +747,6 @@ get_missing_commit_check_level () {
|
761 | 747 | initiate_action () {
|
762 | 748 | case "$1" in
|
763 | 749 | continue)
|
764 |
| - if test ! -d "$rewritten" |
765 |
| - then |
766 |
| - exec git rebase--helper ${force_rebase:+--no-ff} $allow_empty_message \ |
767 |
| - --continue |
768 |
| - fi |
769 | 750 | # do we have anything to commit?
|
770 | 751 | if git diff-index --cached --quiet HEAD --
|
771 | 752 | then
|
@@ -824,12 +805,6 @@ first and then run 'git rebase --continue' again.")"
|
824 | 805 | ;;
|
825 | 806 | skip)
|
826 | 807 | git rerere clear
|
827 |
| - |
828 |
| - if test ! -d "$rewritten" |
829 |
| - then |
830 |
| - exec git rebase--helper ${force_rebase:+--no-ff} $allow_empty_message \ |
831 |
| - --continue |
832 |
| - fi |
833 | 808 | do_rest
|
834 | 809 | return 0
|
835 | 810 | ;;
|
@@ -944,43 +919,11 @@ EOF
|
944 | 919 | }
|
945 | 920 |
|
946 | 921 | expand_todo_ids
|
947 |
| - |
948 |
| - test -d "$rewritten" || test -n "$force_rebase" || |
949 |
| - onto="$(git rebase--helper --skip-unnecessary-picks)" || |
950 |
| - die "Could not skip unnecessary pick commands" |
951 |
| - |
952 | 922 | checkout_onto
|
953 |
| - if test ! -d "$rewritten" |
954 |
| - then |
955 |
| - require_clean_work_tree "rebase" |
956 |
| - exec git rebase--helper ${force_rebase:+--no-ff} $allow_empty_message \ |
957 |
| - --continue |
958 |
| - fi |
959 | 923 | do_rest
|
960 | 924 | }
|
961 | 925 |
|
962 |
| -git_rebase__interactive () { |
963 |
| - initiate_action "$action" |
964 |
| - ret=$? |
965 |
| - if test $ret = 0; then |
966 |
| - return 0 |
967 |
| - fi |
968 |
| - |
969 |
| - setup_reflog_action |
970 |
| - init_basic_state |
971 |
| - |
972 |
| - init_revisions_and_shortrevisions |
973 |
| - |
974 |
| - git rebase--helper --make-script ${keep_empty:+--keep-empty} \ |
975 |
| - ${rebase_merges:+--rebase-merges} \ |
976 |
| - ${rebase_cousins:+--rebase-cousins} \ |
977 |
| - $revisions ${restrict_revision+^$restrict_revision} >"$todo" || |
978 |
| - die "$(gettext "Could not generate todo list")" |
979 |
| - |
980 |
| - complete_action |
981 |
| -} |
982 |
| - |
983 |
| -git_rebase__interactive__preserve_merges () { |
| 926 | +git_rebase__preserve_merges () { |
984 | 927 | initiate_action "$action"
|
985 | 928 | ret=$?
|
986 | 929 | if test $ret = 0; then
|
|
0 commit comments