All of lore.kernel.org
 help / color / mirror / Atom feed
* diff attribute ignored by show and log -p
@ 2009-12-17  4:46 Jay Soffian
  2009-12-17  5:23 ` Jay Soffian
  0 siblings, 1 reply; 5+ messages in thread
From: Jay Soffian @ 2009-12-17  4:46 UTC (permalink / raw)
  To: git

% cat .git/info/attributes
*.xib diff=xibdiff
% cat $(git config diff.xibdiff.command)
#!/bin/sh
trap "rm -f \"$2.tmp\" \"$5.tmp\"" 0 1 2 3 15
ibtool --all "$2" > "$2".tmp
ibtool --all "$5" > "$5".tmp
colordiff -u "$2.tmp" "$5.tmp"

Works great for things like:

% git diff <commit1> <commit2> -- /path/to/*.xib

But is apparently ignored by "git log -p" and "git show" which just
use internal diff. Is this behavior intentional?

j.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: diff attribute ignored by show and log -p
  2009-12-17  4:46 diff attribute ignored by show and log -p Jay Soffian
@ 2009-12-17  5:23 ` Jay Soffian
  2009-12-17 13:17   ` Nanako Shiraishi
  0 siblings, 1 reply; 5+ messages in thread
From: Jay Soffian @ 2009-12-17  5:23 UTC (permalink / raw)
  To: git

On Wed, Dec 16, 2009 at 11:46 PM, Jay Soffian <jaysoffian@gmail.com> wrote:
> % cat .git/info/attributes
> *.xib diff=xibdiff
> % cat $(git config diff.xibdiff.command)
> #!/bin/sh
> trap "rm -f \"$2.tmp\" \"$5.tmp\"" 0 1 2 3 15
> ibtool --all "$2" > "$2".tmp
> ibtool --all "$5" > "$5".tmp
> colordiff -u "$2.tmp" "$5.tmp"
>
> Works great for things like:
>
> % git diff <commit1> <commit2> -- /path/to/*.xib
>
> But is apparently ignored by "git log -p" and "git show" which just
> use internal diff. Is this behavior intentional?

Ah, --ext-diff, and the reasoning behind requiring it for log/show is
explained in 72909be.

j.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: diff attribute ignored by show and log -p
  2009-12-17  5:23 ` Jay Soffian
@ 2009-12-17 13:17   ` Nanako Shiraishi
  2009-12-17 16:44     ` Jay Soffian
  0 siblings, 1 reply; 5+ messages in thread
From: Nanako Shiraishi @ 2009-12-17 13:17 UTC (permalink / raw)
  To: Jay Soffian; +Cc: git

Quoting Jay Soffian <jaysoffian@gmail.com>

>> But is apparently ignored by "git log -p" and "git show" which just
>> use internal diff. Is this behavior intentional?
>
> Ah, --ext-diff, and the reasoning behind requiring it for log/show is
> explained in 72909be.

The need to give --ext-diff is mentioned in 72909be (Add diff-option
--ext-diff, 2007-06-30) but its log message doesn't 'explain' why external
diff isn't used by default and you need to pass that extra option.

Probably --ext-diff should be the default?

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: diff attribute ignored by show and log -p
  2009-12-17 13:17   ` Nanako Shiraishi
@ 2009-12-17 16:44     ` Jay Soffian
  2009-12-17 20:24       ` Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: Jay Soffian @ 2009-12-17 16:44 UTC (permalink / raw)
  To: Nanako Shiraishi; +Cc: git

On Thu, Dec 17, 2009 at 8:17 AM, Nanako Shiraishi <nanako3@lavabit.com> wrote:
> Quoting Jay Soffian <jaysoffian@gmail.com>
>
>>> But is apparently ignored by "git log -p" and "git show" which just
>>> use internal diff. Is this behavior intentional?
>>
>> Ah, --ext-diff, and the reasoning behind requiring it for log/show is
>> explained in 72909be.
>
> The need to give --ext-diff is mentioned in 72909be (Add diff-option
> --ext-diff, 2007-06-30) but its log message doesn't 'explain' why external
> diff isn't used by default and you need to pass that extra option.

"To prevent funky games with external diff engines, git-log and
friends prevent external diff engines from being called."

Seemed reason enough to me.

> Probably --ext-diff should be the default?

Or available via a config option anyway.

j.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: diff attribute ignored by show and log -p
  2009-12-17 16:44     ` Jay Soffian
@ 2009-12-17 20:24       ` Jeff King
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff King @ 2009-12-17 20:24 UTC (permalink / raw)
  To: Jay Soffian; +Cc: Nanako Shiraishi, git

On Thu, Dec 17, 2009 at 11:44:16AM -0500, Jay Soffian wrote:

> > The need to give --ext-diff is mentioned in 72909be (Add diff-option
> > --ext-diff, 2007-06-30) but its log message doesn't 'explain' why external
> > diff isn't used by default and you need to pass that extra option.
> 
> "To prevent funky games with external diff engines, git-log and
> friends prevent external diff engines from being called."
> 
> Seemed reason enough to me.

I don't remember discussing it at that time, but much later when
touching the external diff code and adding textconv, Junio and I came to
the conclusion that textconv was reasonable to do as part of "git log
-p", as the result is just an internal conversion that still results in
a text diff. Whereas an external diff might be terribly confusing, as it
could be spawning graphical viewers or producing output which does not
match well with the log output.

> > Probably --ext-diff should be the default?
> 
> Or available via a config option anyway.

If you were going to do such a config option, it might make sense to
make it an attribute of the diff driver rather than a global "use
external diff". Then each diff driver could say "Yes, I am reasonable to
be run as part of log -p".

-Peff

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-12-17 20:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-17  4:46 diff attribute ignored by show and log -p Jay Soffian
2009-12-17  5:23 ` Jay Soffian
2009-12-17 13:17   ` Nanako Shiraishi
2009-12-17 16:44     ` Jay Soffian
2009-12-17 20:24       ` Jeff King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.