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

Re: gitattributes - clean filter invoked on pull?

From
Dmitry Potapov <dpotapov@gmail.com>
Date
Apr 11, 2011, 10:04 UTC
Message-ID
<BANLkTi=L0rTse2TTNaaO36GUNj5AR1hBXA@mail.gmail.com>
In-Reply-To
<20110411084229.GW5146@genesis.frugalware.org>
Hi,
On Mon, Apr 11, 2011 at 12:42 PM, Miklos Vajna <vmiklos@frugalware.org> wrote:
Show 7 quoted lines
>
> The problem is that it seems the clean filter - which is supposed to be
> invoked only in case a new blob is created - is invoked even on
> clone/pull, and other developers are claiming that it slows down their
> workflow.
>
> Is this a bug? I don't exactly understand why this would be necessary.

No, it is not a bug. Git may invoke the clean filter when a file is not changed to make sure that the file is not changed. It is necessary to prevent a race when a file is changed so quickly that its timestamp does not change. So, what git does is compare timestamp of your file and the index file. Because the index file is written after all files, its timestamp should be later than any file in the repository. However, if the timestamp resolution is not sufficient (i.e. timestamp is the same), git may re-read recently checkout file to make sure that there were no changes to it. During this reading, the clean filter will be invoked.

So, clean filter may be invoked extra time, but smudge filter should not.
Dmitry
Previous: Miklos Vajna
Message 10 of 10 in “gitattributes - clean filter invoked on pull?”
  1. Miklos VajnaApr 11, 2011
  2. Ramkumar RamachandraApr 11, 2011
  3. Miklos VajnaApr 11, 2011
  4. Ramkumar RamachandraApr 11, 2011
  5. Johannes SixtApr 11, 2011
  6. Michael J GruberApr 11, 2011
  7. Miklos VajnaApr 11, 2011
  8. Michael J GruberApr 11, 2011
  9. Miklos VajnaApr 11, 2011
  10. Dmitry PotapovApr 11, 2011

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.