Skip to content

Commit f3d5e46

Browse files
dschospearce
authored andcommitted
rebase -i: use diff plumbing instead of porcelain
When diff drivers are installed, calling "git diff <tree1>..<tree2>" calls those drivers. This borks the patch generation of rebase -i. So use "git diff-tree -p" instead, which does not call diff drivers. Noticed by Johannes Sixt. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Lars Hjemli <[email protected]> Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent 922aa80 commit f3d5e46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

git-rebase--interactive.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ mark_action_done () {
7878

7979
make_patch () {
8080
parent_sha1=$(git rev-parse --verify "$1"^ 2> /dev/null)
81-
git diff "$parent_sha1".."$1" > "$DOTEST"/patch
81+
git diff-tree -p "$parent_sha1".."$1" > "$DOTEST"/patch
8282
}
8383

8484
die_with_patch () {
@@ -302,7 +302,7 @@ do_next () {
302302
git update-ref -m "$message" $HEADNAME $NEWHEAD $OLDHEAD &&
303303
git symbolic-ref HEAD $HEADNAME && {
304304
test ! -f "$DOTEST"/verbose ||
305-
git diff --stat $(cat "$DOTEST"/head)..HEAD
305+
git diff-tree --stat $(cat "$DOTEST"/head)..HEAD
306306
} &&
307307
rm -rf "$DOTEST" &&
308308
warn "Successfully rebased and updated $HEADNAME."

0 commit comments

Comments
 (0)