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

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

From: Clément Poulain <hidden>
Date: 2016-06-15 22:48:54

On Tue, 1 Jun 2010 13:04:27 -0400, Jeff King [off-list ref] wrote:
On Tue, Jun 01, 2010 at 03:41:05PM +0200, Clément Poulain wrote:
quoted
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
It seems to really fit for git gui. 
About the cache : this method will be only used by git gui (when it's
launched) on working tree files, so it seems OK for me.
Thank you
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help