{"thread":{"id":"10204","subject":"'git diff' in rebase--interactive","startedAt":"2007-10-09T08:51:27Z","lastAt":"2007-10-09T14:26:49Z","messageCount":5,"participants":["Johannes Sixt","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"55238","messageId":"470B410F.1040506@viscovery.net","threadId":"10204","inReplyTo":null,"subject":"'git diff' in rebase--interactive","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2007-10-09T08:51:27Z","receivedAt":"2007-10-09T08:51:27Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"I wonder for what reason rebase--interactive generates a patch using\n'git diff' in the make_patch function. Is this an artefact?\n\nI'd like to get rid of this use of 'git diff' because it invokes external \ndiff drivers, which is totally unwanted if the driver is interactive - like \nthe 'windiff' thing that I posted a week ago.\n\n-- Hannes\n"},{"id":"55259","messageId":"Pine.LNX.4.64.0710091319400.4174@racer.site","threadId":"10204","inReplyTo":"470B410F.1040506@viscovery.net","subject":"Re: 'git diff' in rebase--interactive","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-09T12:22:18Z","receivedAt":"2007-10-09T12:22:18Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 9 Oct 2007, Johannes Sixt wrote:\n\n> I wonder for what reason rebase--interactive generates a patch using \n> 'git diff' in the make_patch function. Is this an artefact?\n\nIt was an explicit request by people who use git-rebase regularly, and \nmissed being able to see the patch in --interactive.\n\n> I'd like to get rid of this use of 'git diff' because it invokes \n> external diff drivers, which is totally unwanted if the driver is \n> interactive - like the 'windiff' thing that I posted a week ago.\n\nSo you do not want to be able to run git-rebase (without -i)?\n\nCiao,\nDscho\n"},{"id":"55260","messageId":"470B7581.3030301@viscovery.net","threadId":"10204","inReplyTo":"Pine.LNX.4.64.0710091319400.4174@racer.site","subject":"Re: 'git diff' in rebase--interactive","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2007-10-09T12:35:13Z","receivedAt":"2007-10-09T12:35:13Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Johannes Schindelin schrieb:\n> On Tue, 9 Oct 2007, Johannes Sixt wrote:\n> \n>> I wonder for what reason rebase--interactive generates a patch using \n>> 'git diff' in the make_patch function. Is this an artefact?\n> \n> It was an explicit request by people who use git-rebase regularly, and \n> missed being able to see the patch in --interactive.\n\nCan we generate the patch with plumbing, diff-{files,index,tree}? They \nby-pass any diff drivers.\n\n>> I'd like to get rid of this use of 'git diff' because it invokes \n>> external diff drivers, which is totally unwanted if the driver is \n>> interactive - like the 'windiff' thing that I posted a week ago.\n> \n> So you do not want to be able to run git-rebase (without -i)?\n\nIt wouldn't work anyway in my use-case (versioned Word documents), but \nrebase -m and rebase -i could run without manual intervention as long as \nthere are no content merges.\n\nIn this particular case, I only wanted to amend the message of a commit 3 \nsteps down in the history, and I had not expected any diff drivers to be \nfired up.\n\n-- Hannes\n"},{"id":"55270","messageId":"Pine.LNX.4.64.0710091353140.4174@racer.site","threadId":"10204","inReplyTo":"470B7581.3030301@viscovery.net","subject":"[PATCH] rebase -i: use diff plumbing instead of porcelain","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-09T12:59:43Z","receivedAt":"2007-10-09T12:59:43Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nWhen diff drivers are installed, calling \"git diff <tree1>..<tree2>\"\ncalls those drivers.  This borks the patch generation of rebase -i.\nSo use \"git diff-tree -p\" instead, which does not call diff drivers.\n\nNoticed by Johannes Sixt.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tOn Tue, 9 Oct 2007, Johannes Sixt wrote:\n\n\t> Johannes Schindelin schrieb:\n\t> > On Tue, 9 Oct 2007, Johannes Sixt wrote:\n\t> > \n\t> > > I wonder for what reason rebase--interactive generates a \n\t> > > patch using 'git diff' in the make_patch function. Is this \n\t> > > an artefact?\n\t> > \n\t> > It was an explicit request by people who use git-rebase \n\t> > regularly, and missed being able to see the patch in \n\t> > --interactive.\n\t> \n\t> Can we generate the patch with plumbing, \n\t> diff-{files,index,tree}? They by-pass any diff drivers.\n\n\tHere you are.\n\n git-rebase--interactive.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 050140d..df4cedb 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -80,7 +80,7 @@ mark_action_done () {\n make_patch () {\n \tparent_sha1=$(git rev-parse --verify \"$1\"^) ||\n \t\tdie \"Cannot get patch for $1^\"\n-\tgit diff \"$parent_sha1\"..\"$1\" > \"$DOTEST\"/patch\n+\tgit diff-tree -p \"$parent_sha1\"..\"$1\" > \"$DOTEST\"/patch\n \ttest -f \"$DOTEST\"/message ||\n \t\tgit cat-file commit \"$1\" | sed \"1,/^$/d\" > \"$DOTEST\"/message\n \ttest -f \"$DOTEST\"/author-script ||\n@@ -325,7 +325,7 @@ do_next () {\n \t\t;;\n \tesac && {\n \t\ttest ! -f \"$DOTEST\"/verbose ||\n-\t\t\tgit diff --stat $(cat \"$DOTEST\"/head)..HEAD\n+\t\t\tgit diff-tree --stat $(cat \"$DOTEST\"/head)..HEAD\n \t} &&\n \trm -rf \"$DOTEST\" &&\n \tgit gc --auto &&\n-- \n1.5.3.4.1169.g5fb8d\n"},{"id":"55286","messageId":"470B8FA9.3090600@viscovery.net","threadId":"10204","inReplyTo":"Pine.LNX.4.64.0710091353140.4174@racer.site","subject":"Re: [PATCH] rebase -i: use diff plumbing instead of porcelain","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2007-10-09T14:26:49Z","receivedAt":"2007-10-09T14:26:49Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Johannes Schindelin schrieb:\n> When diff drivers are installed, calling \"git diff <tree1>..<tree2>\"\n> calls those drivers.  This borks the patch generation of rebase -i.\n> So use \"git diff-tree -p\" instead, which does not call diff drivers.\n\nThanks a lot! That works much better.\n\n-- Hannes\n"}]}