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

Git filter clean not working when staging files

From
RTRafał Treffler <tothamon@gmail.com>
Date
Nov 29, 2017, 17:58 UTC
Message-ID
<CAHY8k2DJSQjXrjTq6nysnifNppzLtSsORqseB2J0q1bYnkCF-A@mail.gmail.com>
Hello,

I've got a question or maybe bug about Git clean filter. According to documentation[1] clean should be run when staging files. When I'm staging file I see my script was run (I'm logging execution into /tmp), but file content is unmodified. My script is reading stdin and writing to stdout. Nothing breaks in the script, from logs I see the source and modified content are proper and I'm returning 0 return code.

Is this behavior intended? What should I do to modify the content?

Smudge works as intended. But I've also noticed that git status runs clean filter but does not modify contents. Is that also intended?

Maybe I'm missing something?

If this is not going to work, is there other way to modify file content on commit? (so the fixed content goes to local repo) Any other options ?

[1] https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#filters_b
-- 
Thanks for help,
Rafal
Message 1 of 1 in “Git filter clean not working when staging files”
  1. Rafał TrefflerNov 29, 2017

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.