git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Cristian Morales Vega <christian.morales.vega@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git checkout behaviour when only ctime of file changes
Date: Mon, 19 Apr 2021 13:47:26 -0700	[thread overview]
Message-ID: <xmqqh7k29f35.fsf@gitster.g> (raw)
In-Reply-To: <CAOWQn3Qesh0+CkaD95q78Rq_vN5tjWKDe7HTk0Ynk-NY8XUKzg@mail.gmail.com> (Cristian Morales Vega's message of "Mon, 19 Apr 2021 10:11:12 +0100")

Cristian Morales Vega <christian.morales.vega@gmail.com> writes:

> 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).


  parent reply	other threads:[~2021-04-19 20:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19  9:11 git checkout behaviour when only ctime of file changes Cristian Morales Vega
2021-04-19 11:10 ` Bagas Sanjaya
2021-04-19 11:23   ` Cristian Morales Vega
2021-04-19 20:47 ` Junio C Hamano [this message]
2021-04-20  2:04 ` brian m. carlson
2021-04-20  6:10   ` Cristian Morales Vega

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=xmqqh7k29f35.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=christian.morales.vega@gmail.com \
    --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).