git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Damien Cassou <damien@cassou.me>
To: git@vger.kernel.org
Subject: git status shows a different result depending on how fast a file is changed
Date: Fri, 22 Aug 2025 17:10:48 +0200	[thread overview]
Message-ID: <m0o6s7xuh3.fsf@cassou.me> (raw)

[-- 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 --]

             reply	other threads:[~2025-08-22 15:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-22 15:10 Damien Cassou [this message]
2025-08-26 15:38 ` git status shows a different result depending on how fast a file is changed Damien Cassou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m0o6s7xuh3.fsf@cassou.me \
    --to=damien@cassou.me \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).