Re: [PATCH 0/4] diff text conversion filter
- From
Jeff King <peff@peff.net>
- Date
- Oct 7, 2008, 06:00 UTC
- Message-ID
- <20081007060014.GA7965@coredump.intra.peff.net>
- In-Reply-To
- <48EAF902.3040402@viscovery.net>
On Tue, Oct 07, 2008 at 07:52:02AM +0200, Johannes Sixt wrote:
Show 5 quoted lines
> How about this: If I run 'git show -- foo.doc' (foo.doc resolves to a > single path, obviously), I want MS Word, but for other uses of 'git show' > I don't. I think that heuristics could be very effective: With a plain > 'git show' I get the overview of the change, and with 'git show -- > foo.doc' I drill down into a single document.
Hrm. I am not opposed to heuristics, but in this case, I don't like the one you have proposed. ;P
My specific case that prompted this work is a repository full of pictures and videos, where I rarely (if ever) change the media content, but frequently change exif tags. So my "usual" case is to want to see "git log -p" with the textconv'd version. The commit diffs are otherwise totally meaningless.
But I think for many others, they are primarily working with text data, but have some (for example) binary word processor documents. Triggering such conversions for a single file might make more sense there.
So I'm not sure there is a heuristic that serves both desires. Which is why I would lean towards a command-line argument, backed by a config option for those repositories which really want it all the time (and let me reiterate that such a config option would still have _no_ impact on plumbing; applying text conversion there is just plain wrong).
> Or this: 'git show -p' uses the textconv'd version, 'git show' does not
> ("Binary files differ").At that point, is there really an advantage over "git show --textconv"?
> BTW, also with 'git diff' I sometimes don't want MS Word to pop up...
Yes. It is annoying that git can't simply read our minds. :)
-Peff