Skip to content

Commit

Permalink
rebase -i: give rerere a chance
Browse files Browse the repository at this point in the history
Like non-interactive rebase, interactive mode now calls rerere when
appropriate.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Nov 29, 2007
1 parent d25430c commit ecfe72f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion git-rebase--interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ make_patch () {

die_with_patch () {
make_patch "$1"
git rerere
die "$2"
}

Expand Down Expand Up @@ -175,13 +176,13 @@ pick_one_preserving_merges () {
msg="$(git cat-file commit $sha1 | sed -e '1,/^$/d')"
# No point in merging the first parent, that's HEAD
new_parents=${new_parents# $first_parent}
# NEEDSWORK: give rerere a chance
if ! GIT_AUTHOR_NAME="$GIT_AUTHOR_NAME" \
GIT_AUTHOR_EMAIL="$GIT_AUTHOR_EMAIL" \
GIT_AUTHOR_DATE="$GIT_AUTHOR_DATE" \
output git merge $STRATEGY -m "$msg" \
$new_parents
then
git rerere
printf "%s\n" "$msg" > "$GIT_DIR"/MERGE_MSG
die Error redoing merge $sha1
fi
Expand Down Expand Up @@ -369,6 +370,7 @@ do
--abort)
comment_for_reflog abort

git rerere clear
test -d "$DOTEST" || die "No interactive rebase running"

HEADNAME=$(cat "$DOTEST"/head-name)
Expand All @@ -385,6 +387,7 @@ do
--skip)
comment_for_reflog skip

git rerere clear
test -d "$DOTEST" || die "No interactive rebase running"

output git reset --hard && do_rest
Expand Down

0 comments on commit ecfe72f

Please sign in to comment.