* 'git diff' in rebase--interactive
@ 2007-10-09 8:51 Johannes Sixt
2007-10-09 12:22 ` Johannes Schindelin
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Sixt @ 2007-10-09 8:51 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Git Mailing List
I wonder for what reason rebase--interactive generates a patch using
'git diff' in the make_patch function. Is this an artefact?
I'd like to get rid of this use of 'git diff' because it invokes external
diff drivers, which is totally unwanted if the driver is interactive - like
the 'windiff' thing that I posted a week ago.
-- Hannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 'git diff' in rebase--interactive
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
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Schindelin @ 2007-10-09 12:22 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Git Mailing List
Hi,
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.
> I'd like to get rid of this use of 'git diff' because it invokes
> external diff drivers, which is totally unwanted if the driver is
> interactive - like the 'windiff' thing that I posted a week ago.
So you do not want to be able to run git-rebase (without -i)?
Ciao,
Dscho
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 'git diff' in rebase--interactive
2007-10-09 12:22 ` Johannes Schindelin
@ 2007-10-09 12:35 ` Johannes Sixt
2007-10-09 12:59 ` [PATCH] rebase -i: use diff plumbing instead of porcelain Johannes Schindelin
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Sixt @ 2007-10-09 12:35 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Git Mailing List
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.
>> I'd like to get rid of this use of 'git diff' because it invokes
>> external diff drivers, which is totally unwanted if the driver is
>> interactive - like the 'windiff' thing that I posted a week ago.
>
> So you do not want to be able to run git-rebase (without -i)?
It wouldn't work anyway in my use-case (versioned Word documents), but
rebase -m and rebase -i could run without manual intervention as long as
there are no content merges.
In this particular case, I only wanted to amend the message of a commit 3
steps down in the history, and I had not expected any diff drivers to be
fired up.
-- Hannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] rebase -i: use diff plumbing instead of porcelain
2007-10-09 12:35 ` Johannes Sixt
@ 2007-10-09 12:59 ` Johannes Schindelin
2007-10-09 14:26 ` Johannes Sixt
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Schindelin @ 2007-10-09 12:59 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Git Mailing List
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] rebase -i: use diff plumbing instead of porcelain
2007-10-09 12:59 ` [PATCH] rebase -i: use diff plumbing instead of porcelain Johannes Schindelin
@ 2007-10-09 14:26 ` Johannes Sixt
0 siblings, 0 replies; 5+ messages in thread
From: Johannes Sixt @ 2007-10-09 14:26 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Git Mailing List
Johannes Schindelin schrieb:
> 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.
Thanks a lot! That works much better.
-- Hannes
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-10-09 14:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH] rebase -i: use diff plumbing instead of porcelain Johannes Schindelin
2007-10-09 14:26 ` Johannes Sixt
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).