{"thread":{"id":"64013","subject":"git status shows a different result depending on how fast a file is changed","startedAt":"2025-08-22T15:16:57Z","lastAt":"2025-08-26T15:38:34Z","messageCount":2,"participants":["Damien Cassou"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"524715","messageId":"m0o6s7xuh3.fsf@cassou.me","threadId":"64013","inReplyTo":null,"subject":"git status shows a different result depending on how fast a file is changed","fromName":"Damien Cassou","fromEmail":"damien@cassou.me","sentAt":"2025-08-22T15:10:48Z","receivedAt":"2025-08-22T15:16:57Z","isPatch":false,"sender":{"key":"damien@cassou.me","avatar":null},"body":"Hi,\n\nThe attached script has a commented \"sleep 1s\" line in the middle. If it\nis commented, \"git status\" at the end will not list your last changes to\nfoo.txt (which I find a weird behavior). If you uncomment the line, \"git\nstatus\" will see your changes.\n\nMy global Git configuration file ~/.config/git/config only contains\nsettings for user.name and user.email. I can reproduce both on macOS and\nGNU/Linux. My Git version is 2.50.1.\n\nI realize that if the date of foo.txt at the end of the script is\nchanged then \"git status\" will always detect the change. I also realize\nthat if the size of foo.txt changes then \"git status\" will always\ndetect the change.\n\nCan somebody explain me how the \"delay 1s\" command can change the\nbehavior of \"git status\"? If you know where in the C code this behavior\nis implemented, I'm interested as well.\n\nThank you very much\n\n-- \nDamien Cassou\n\n\"Success is the ability to go from one failure to another without\nlosing enthusiasm.\" --Winston Churchill\n"},{"id":"524967","messageId":"m08qj6jdov.fsf@cassou.me","threadId":"64013","inReplyTo":"m0o6s7xuh3.fsf@cassou.me","subject":"Re: git status shows a different result depending on how fast a file is changed","fromName":"Damien Cassou","fromEmail":"damien@cassou.me","sentAt":"2025-08-26T15:38:24Z","receivedAt":"2025-08-26T15:38:34Z","isPatch":false,"sender":{"key":"damien@cassou.me","avatar":null},"body":"Damien Wyart sent me a bunch of links explaining my issue and allowed\nme to send them to the list in his name:\n\nhttps://git-scm.com/docs/racy-git\nhttp://www-cs-students.stanford.edu/~blynn/gg/race.html\nhttps://tylercipriani.com/blog/2023/11/30/racy-git/\nhttps://github.com/git-lfs/git-lfs/issues/196\nhttps://stackoverflow.com/a/71003895\nhttps://speakerdeck.com/msohn/racy-jgit-a-short-history-of-time\n\nBest,\n\n-- \nDamien Cassou\n\n\"Success is the ability to go from one failure to another without\nlosing enthusiasm.\" --Winston Churchill\n"}]}