git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: [PATCH] rebase -i: use diff plumbing instead of porcelain
Date: Tue, 9 Oct 2007 13:59:43 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0710091353140.4174@racer.site> (raw)
In-Reply-To: <470B7581.3030301@viscovery.net>


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 <johannes.schindelin@gmx.de>
---

	On Tue, 9 Oct 2007, Johannes Sixt wrote:

	> Johannes Schindelin schrieb:
	> > On Tue, 9 Oct 2007, Johannes Sixt wrote:
	> > 
	> > > I wonder for what reason rebase--interactive generates a 
	> > > patch using 'git diff' in the make_patch function. Is this 
	> > > an artefact?
	> > 
	> > It was an explicit request by people who use git-rebase 
	> > regularly, and missed being able to see the patch in 
	> > --interactive.
	> 
	> Can we generate the patch with plumbing, 
	> diff-{files,index,tree}? They by-pass any diff drivers.

	Here you are.

 git-rebase--interactive.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 050140d..df4cedb 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -80,7 +80,7 @@ mark_action_done () {
 make_patch () {
 	parent_sha1=$(git rev-parse --verify "$1"^) ||
 		die "Cannot get patch for $1^"
-	git diff "$parent_sha1".."$1" > "$DOTEST"/patch
+	git diff-tree -p "$parent_sha1".."$1" > "$DOTEST"/patch
 	test -f "$DOTEST"/message ||
 		git cat-file commit "$1" | sed "1,/^$/d" > "$DOTEST"/message
 	test -f "$DOTEST"/author-script ||
@@ -325,7 +325,7 @@ do_next () {
 		;;
 	esac && {
 		test ! -f "$DOTEST"/verbose ||
-			git diff --stat $(cat "$DOTEST"/head)..HEAD
+			git diff-tree --stat $(cat "$DOTEST"/head)..HEAD
 	} &&
 	rm -rf "$DOTEST" &&
 	git gc --auto &&
-- 
1.5.3.4.1169.g5fb8d

  reply	other threads:[~2007-10-09 13:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-09  8:51 'git diff' in rebase--interactive Johannes Sixt
2007-10-09 12:22 ` Johannes Schindelin
2007-10-09 12:35   ` Johannes Sixt
2007-10-09 12:59     ` Johannes Schindelin [this message]
2007-10-09 14:26       ` [PATCH] rebase -i: use diff plumbing instead of porcelain Johannes Sixt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0710091353140.4174@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).