From: "Randall S. Becker" <rsbecker@nexbridge.com>
To: "'Jeff King'" <peff@peff.net>
Cc: <git@vger.kernel.org>
Subject: RE: [Question] Diff text filters and git add
Date: Wed, 10 Jul 2019 08:44:47 -0400 [thread overview]
Message-ID: <00bb01d5371d$453a8520$cfaf8f60$@nexbridge.com> (raw)
In-Reply-To: <20190709215104.GA20936@sigill.intra.peff.net>
On July 9, 2019 5:51 PM, Peff wrote:
> To: Randall S. Becker <rsbecker@nexbridge.com>
> Cc: git@vger.kernel.org
> Subject: Re: [Question] Diff text filters and git add
>
> On Tue, Jul 09, 2019 at 05:43:05PM -0400, Randall S. Becker wrote:
>
> > I am trying to do something a bit strange and wonder about the best
> > way to go. I have a text filter that presents content of very special
> > binary file formats using textconv. What I am wondering is whether
> > using the textconv mechanism is sufficient to have git calculate the
> > file signature or whether I need to use an external diff engine, so
> > that git add behaves in a stable manner (i.e., does git internally use
> > the textconv mechanism for evaluating whether a file changed or
> > whether the external diff engine is required, or whether this is even
> possible at all).
>
> No, textconv only applies when generating a diff to output, and will never
> impact what's stored in Git.
>
> It sounds like you might want a clean filter instead, to sanitize the file
> contents as they come into Git (and perhaps a matching smudge filter to
> convert back to the working-tree version if necessary).
>
> You're talking about "the diff engine" here, but note that git-add would never
> do a diff at all. It cares only about full sha1s (and optimizes out re-computing
> the sha1 on each invocation by using stat data). So outside of clean/smudge,
> there's nothing else going on.
Thanks. I can script this instead. Will do an external diff then --assume-unchanged when I detect an equivalence.
Appreciate the advice and info,
Randall
next prev parent reply other threads:[~2019-07-10 12:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-09 21:43 [Question] Diff text filters and git add Randall S. Becker
2019-07-09 21:51 ` Jeff King
2019-07-10 12:44 ` Randall S. Becker [this message]
2019-07-11 17:28 ` Jakub Narebski
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='00bb01d5371d$453a8520$cfaf8f60$@nexbridge.com' \
--to=rsbecker@nexbridge.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.