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

[Question] Diff text filters and git add

From
Randall S. Becker <rsbecker@nexbridge.com>
Date
Jul 9, 2019, 21:43 UTC
Message-ID
<009201d5369f$4da5d030$e8f17090$@nexbridge.com>
Hi all,

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).

The basic use case is that there is a timestamp embedded in the binary file that I want to forever ignore when committing. I only need this done on one specific machine, which is under Jenkins control, so it's not something developers would deal with at all (so the filter config is in one place). When the binary generator runs, if the two file images are "similar enough" (as in: the same except for the generated timestamp, and a couple of other annoying bits of metadata), I want git to think that they are the same in an automated way, so that when I am constructing commits, I do not want what would be considered a duplicate of what is essentially the same file.

Sadly, I cannot modify the generator, so I'm stuck with the files being wonky. I also cannot run the generator anywhere downstream, so doing so on the deployment engine is also not an option (don't ask, the generator is limited on where it can be run). Suggestions are welcome, please.

Thanks, Randall

Next: Jeff King
Message 1 of 4 in “[Question] Diff text filters and git add”
  1. Randall S. BeckerJul 9, 2019
  2. Jeff KingJul 9, 2019
  3. Randall S. BeckerJul 10, 2019
  4. Jakub NarebskiJul 11, 2019

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.