git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Clément Poulain" <clement.poulain@ensimag.imag.fr>
To: <git@vger.kernel.org>
Subject: Re: Best way to apply textconv to a working tree file
Date: Wed, 02 Jun 2010 11:56:59 +0200	[thread overview]
Message-ID: <1725d013942b49b804102cca573d2999@ensimag.fr> (raw)
In-Reply-To: <20100601170426.GC9702@sigill.intra.peff.net>

On Tue, 1 Jun 2010 13:04:27 -0400, Jeff King <peff@peff.net> wrote:
> 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

      reply	other threads:[~2010-06-02  9:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-01 13:41 Best way to apply textconv to a working tree file Clément Poulain
2010-06-01 16:07 ` Matthieu Moy
2010-06-01 17:14   ` Jeff King
2010-06-01 17:30     ` Matthieu Moy
2010-06-01 19:50       ` Jeff King
2010-06-02 15:12         ` Clément Poulain
2010-06-01 17:04 ` Jeff King
2010-06-02  9:56   ` Clément Poulain [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1725d013942b49b804102cca573d2999@ensimag.fr \
    --to=clement.poulain@ensimag.imag.fr \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).