summaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-03-06 14:54:02 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-03-06 14:54:02 -0800
commit9ca488c04bdab90668471640baeb0d9140be064c (patch)
tree6a1e4c6acaff06f234b12fdbb0b4ad9ab3bc8048 /git-rebase--interactive.sh
parentMerge branch 'xz/send-email-batch-size' (diff)
parentrebase: introduce and use pseudo-ref REBASE_HEAD (diff)
downloadtgif-9ca488c04bdab90668471640baeb0d9140be064c.tar.xz
Merge branch 'nd/rebase-show-current-patch'
The new "--show-current-patch" option gives an end-user facing way to get the diff being applied when "git rebase" (and "git am") stops with a conflict. * nd/rebase-show-current-patch: rebase: introduce and use pseudo-ref REBASE_HEAD rebase: add --show-current-patch am: add --show-current-patch
Diffstat (limited to 'git-rebase--interactive.sh')
-rw-r--r--git-rebase--interactive.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 637bb3ecd5..331c8dfeac 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -199,12 +199,14 @@ make_patch () {
die_with_patch () {
echo "$1" > "$state_dir"/stopped-sha
+ git update-ref REBASE_HEAD "$1"
make_patch "$1"
die "$2"
}
exit_with_patch () {
echo "$1" > "$state_dir"/stopped-sha
+ git update-ref REBASE_HEAD "$1"
make_patch $1
git rev-parse --verify HEAD > "$amend"
gpg_sign_opt_quoted=${gpg_sign_opt:+$(git rev-parse --sq-quote "$gpg_sign_opt")}
@@ -844,6 +846,9 @@ To continue rebase after editing, run:
exit
;;
+show-current-patch)
+ exec git show REBASE_HEAD --
+ ;;
esac
comment_for_reflog start
@@ -859,6 +864,7 @@ fi
orig_head=$(git rev-parse --verify HEAD) || die "$(gettext "No HEAD?")"
mkdir -p "$state_dir" || die "$(eval_gettext "Could not create temporary \$state_dir")"
+rm -f "$(git rev-parse --git-path REBASE_HEAD)"
: > "$state_dir"/interactive || die "$(gettext "Could not mark as interactive")"
write_basic_state