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:
authorAlban Gruin <alban.gruin@gmail.com>2018-05-28 15:34:20 +0300
committerJunio C Hamano <gitster@pobox.com>2018-06-01 03:34:48 +0300
commitef64bb328df9c131c6c454ad65169fa3972da512 (patch)
treebbf4785068ae5d8ebec27aa3f6edc8a830c8703e /git-rebase--preserve-merges.sh
parentc42abfe785729587643dec5e7bba414dc3943817 (diff)
rebase: strip unused code in git-rebase--preserve-merges.sh
This removes the code coming from git-rebase--interactive.sh that is not needed by preserve-merges, and changes the header comment accordingly. In a following commit, the -p code from git-rebase--interactive.sh will be stripped out. As preserve-merges’ successor is already in the works, this will be the only script to be converted. This also seems to fix a bug where a failure in `pick_one_preserving_merges()` would fallback to the non-preserve-merges `pick_one()`. Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Diffstat (limited to 'git-rebase--preserve-merges.sh')
-rw-r--r--git-rebase--preserve-merges.sh65
1 files changed, 4 insertions, 61 deletions
diff --git a/git-rebase--preserve-merges.sh b/git-rebase--preserve-merges.sh
index 2f4941d0fc..c51c7828e7 100644
--- a/git-rebase--preserve-merges.sh
+++ b/git-rebase--preserve-merges.sh
@@ -1,12 +1,8 @@
-# This shell script fragment is sourced by git-rebase to implement
-# its interactive mode. "git rebase --interactive" makes it easy
-# to fix up commits in the middle of a series and rearrange commits.
+# This shell script fragment is sourced by git-rebase to implement its
+# preserve-merges mode.
#
# Copyright (c) 2006 Johannes E. Schindelin
#
-# The original idea comes from Eric W. Biederman, in
-# https://public-inbox.org/git/m1odwkyuf5.fsf_-_@ebiederm.dsl.xmission.com/
-#
# The file containing rebase commands, comments, and empty lines.
# This file is created by "git rebase -i" then edited by the user. As
# the lines are processed, they are removed from the front of this
@@ -287,17 +283,7 @@ pick_one () {
empty_args="--allow-empty"
fi
- test -d "$rewritten" &&
- 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")} \
- $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.
- ret=$?
- case "$ret" in [01]) ;; *) reschedule_last_action ;; esac
- return $ret
+ pick_one_preserving_merges "$@"
}
pick_one_preserving_merges () {
@@ -761,11 +747,6 @@ get_missing_commit_check_level () {
initiate_action () {
case "$1" in
continue)
- if test ! -d "$rewritten"
- then
- exec git rebase--helper ${force_rebase:+--no-ff} $allow_empty_message \
- --continue
- fi
# do we have anything to commit?
if git diff-index --cached --quiet HEAD --
then
@@ -824,12 +805,6 @@ first and then run 'git rebase --continue' again.")"
;;
skip)
git rerere clear
-
- if test ! -d "$rewritten"
- then
- exec git rebase--helper ${force_rebase:+--no-ff} $allow_empty_message \
- --continue
- fi
do_rest
return 0
;;
@@ -944,43 +919,11 @@ EOF
}
expand_todo_ids
-
- test -d "$rewritten" || test -n "$force_rebase" ||
- onto="$(git rebase--helper --skip-unnecessary-picks)" ||
- die "Could not skip unnecessary pick commands"
-
checkout_onto
- if test ! -d "$rewritten"
- then
- require_clean_work_tree "rebase"
- exec git rebase--helper ${force_rebase:+--no-ff} $allow_empty_message \
- --continue
- fi
do_rest
}
-git_rebase__interactive () {
- initiate_action "$action"
- ret=$?
- if test $ret = 0; then
- return 0
- fi
-
- setup_reflog_action
- init_basic_state
-
- init_revisions_and_shortrevisions
-
- git rebase--helper --make-script ${keep_empty:+--keep-empty} \
- ${rebase_merges:+--rebase-merges} \
- ${rebase_cousins:+--rebase-cousins} \
- $revisions ${restrict_revision+^$restrict_revision} >"$todo" ||
- die "$(gettext "Could not generate todo list")"
-
- complete_action
-}
-
-git_rebase__interactive__preserve_merges () {
+git_rebase__preserve_merges () {
initiate_action "$action"
ret=$?
if test $ret = 0; then