git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
CPClément Poulain <clement.poulain@ensimag.imag.fr>
Date
Jun 2, 2010, 09:56 UTC
Message-ID
<1725d013942b49b804102cca573d2999@ensimag.fr>
In-Reply-To
<20100601170426.GC9702@sigill.intra.peff.net>
On Tue, 1 Jun 2010 13:04:27 -0400, Jeff King <peff@peff.net> wrote:
Show 22 quoted lines
> 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

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

Previous: Jeff King
Message 8 of 8 in “Best way to apply textconv to a working tree file”
  1. Clément PoulainJun 1, 2010
  2. Matthieu MoyJun 1, 2010
  3. Jeff KingJun 1, 2010
  4. Matthieu MoyJun 1, 2010
  5. Jeff KingJun 1, 2010
  6. Clément PoulainJun 2, 2010
  7. Jeff KingJun 1, 2010
  8. Clément PoulainJun 2, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.