public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* git status shows a different result depending on how fast a file is changed
@ 2025-08-22 15:10 Damien Cassou
  2025-08-26 15:38 ` Damien Cassou
  0 siblings, 1 reply; 2+ messages in thread
From: Damien Cassou @ 2025-08-22 15:10 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 984 bytes --]

Hi,

The attached script has a commented "sleep 1s" line in the middle. If it
is commented, "git status" at the end will not list your last changes to
foo.txt (which I find a weird behavior). If you uncomment the line, "git
status" will see your changes.

My global Git configuration file ~/.config/git/config only contains
settings for user.name and user.email. I can reproduce both on macOS and
GNU/Linux. My Git version is 2.50.1.

I realize that if the date of foo.txt at the end of the script is
changed then "git status" will always detect the change. I also realize
that if the size of foo.txt changes then "git status" will always
detect the change.

Can somebody explain me how the "delay 1s" command can change the
behavior of "git status"? If you know where in the C code this behavior
is implemented, I'm interested as well.

Thank you very much

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill

[-- Attachment #2: git-use-cases.sh --]
[-- Type: application/x-sh, Size: 880 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: git status shows a different result depending on how fast a file is changed
  2025-08-22 15:10 git status shows a different result depending on how fast a file is changed Damien Cassou
@ 2025-08-26 15:38 ` Damien Cassou
  0 siblings, 0 replies; 2+ messages in thread
From: Damien Cassou @ 2025-08-26 15:38 UTC (permalink / raw)
  To: git

Damien Wyart sent me a bunch of links explaining my issue and allowed
me to send them to the list in his name:

https://git-scm.com/docs/racy-git
http://www-cs-students.stanford.edu/~blynn/gg/race.html
https://tylercipriani.com/blog/2023/11/30/racy-git/
https://github.com/git-lfs/git-lfs/issues/196
https://stackoverflow.com/a/71003895
https://speakerdeck.com/msohn/racy-jgit-a-short-history-of-time

Best,

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-26 15:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-22 15:10 git status shows a different result depending on how fast a file is changed Damien Cassou
2025-08-26 15:38 ` Damien Cassou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox