Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

Re: Best way to apply textconv to a working tree file

From: Jeff King <hidden>
Date: 2016-06-15 22:48:53

On Tue, Jun 01, 2010 at 03:41:05PM +0200, Clément Poulain wrote:
We are wondering what is the best way to do the textconv. Here are some
solutions we thought about:
One solution you didn't mention would be to do it all yourself:

  driver=`git check-attr diff "$file" | cut -d: -f3`
  textconv=`git config diff.$driver.textconv`
  $textconv <$file >$file.converted

This has the advantage of working with existing versions of git. The
downside is that it's more code (e.g., my parsing above is quite sloppy
and loose. Doing it right would be a few more lines).

Furthermore, it doesn't use the textconv cache at all. For working tree
files, this might not matter (if you pull the sha1 out of the index,
though, you can still check the cache, and unchanged working tree files
are likely to be in the cache). But for blobs in general, the cache is
worth using.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help