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

Re: git smudge filter fails

From
Jeff King <peff@peff.net>
Date
Mar 10, 2016, 21:05 UTC
Message-ID
<20160310210544.GB30595@sigill.intra.peff.net>
In-Reply-To
<CAH8BJxFmAQtoF+1Q7Ub5qWnz5UewrPS4e8JQWms254hO_E05Hw@mail.gmail.com>
On Thu, Mar 10, 2016 at 09:45:19AM -0500, Stephen Morton wrote:
Show 5 quoted lines
> I am a bit confused because this is basically the example used in
> ProGit [1] and it is fundamentally broken. In fact, if I understand
> correctly, this means that smudge filters cannot be relied upon to
> provide any 'keyword expansion' type tasks because they will all by
> nature have to query the file with 'git log'.

Interesting. Perhaps I am missing something (I am far from an expert in clean/smudge filters, which I do not generally use myself), but the example in ProGit looks kind of bogus to me. I don't think it ever would have worked reliably, under any version of git.

> (Note that although in my example I used 'git checkout', with an only
> slightly more complicated example I can make it fail on 'git pull'
> which is perhaps a much more realistic use case. That was probably
> implied in your answer, I just wanted to mention it.)

Yeah, I think the issue is basically the same for several commands which update the worktree and the HEAD. Most of them are going to do the worktree first.

-Peff
Previous: Stephen MortonNext: Junio C Hamano
Message 4 of 7 in “git smudge filter fails”
  1. Stephen MortonMar 9, 2016
  2. Jeff KingMar 10, 2016
  3. Stephen MortonMar 10, 2016
  4. Jeff KingMar 10, 2016
  5. Junio C HamanoMar 10, 2016
  6. Stephen MortonMar 15, 2016
  7. Junio C HamanoMar 15, 2016

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.