git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "Randall S. Becker" <rsbecker@nexbridge.com>
Cc: git@vger.kernel.org
Subject: Re: [Question] Diff text filters and git add
Date: Tue, 9 Jul 2019 16:51:04 -0500	[thread overview]
Message-ID: <20190709215104.GA20936@sigill.intra.peff.net> (raw)
In-Reply-To: <009201d5369f$4da5d030$e8f17090$@nexbridge.com>

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.

-Peff

  reply	other threads:[~2019-07-09 21:51 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 [this message]
2019-07-10 12:44   ` Randall S. Becker
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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20190709215104.GA20936@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=rsbecker@nexbridge.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).