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

Re: git checkout behaviour when only ctime of file changes

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 19, 2021, 20:47 UTC
Message-ID
<xmqqh7k29f35.fsf@gitster.g>
In-Reply-To
<CAOWQn3Qesh0+CkaD95q78Rq_vN5tjWKDe7HTk0Ynk-NY8XUKzg@mail.gmail.com>
Cristian Morales Vega <christian.morales.vega@gmail.com> writes:
Show 6 quoted lines
> I thought you may want to take a look at
> https://issues.jenkins.io/browse/JENKINS-65395.
>
> Basically after something updates the ctime of a file, a
> "git checkout" can behave differently depending on whether a
> "git update-index --refresh" has been run before or not.

Changes to ctime, not just to mtime, participate in "the path may have been changed so need to go back to the contents to see if it truly has" logic, and "update-index --refresh" is a mechanism to clear that "the path may have been changed" bit.

So if your "behave differently ... with or without refresh" happens equally if you replace 'ctime' in your statement with 'mtime', then everything is working as designed. But it was unclear from your description.

Assuming that the difference with and without refresh after mtime change is the same as the difference with and without refresh after ctime change, the "core.trustctime" configuration variable is for those whose files have untrustworthy ctime (due to background scanners and other funnies).

Previous: Cristian Morales VegaNext: brian m. carlson
Message 4 of 6 in “git checkout behaviour when only ctime of file changes”
  1. Cristian Morales VegaApr 19, 2021
  2. Bagas SanjayaApr 19, 2021
  3. Cristian Morales VegaApr 19, 2021
  4. Junio C HamanoApr 19, 2021
  5. brian m. carlsonApr 20, 2021
  6. Cristian Morales VegaApr 20, 2021

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.