git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Thomas Gummerer <t.gummerer@gmail.com>
Cc: git@vger.kernel.org, rsbecker@nexbridge.com,
	johannes.schindelin@gmx.de, larsxschneider@gmail.com,
	szeder.dev@gmail.com
Subject: Re: [PATCH] t0021: make sure clean filter runs
Date: Wed, 21 Aug 2019 08:40:49 -0700	[thread overview]
Message-ID: <xmqq36huttku.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20190821145215.GA2679@cat> (Thomas Gummerer's message of "Wed, 21 Aug 2019 15:52:15 +0100")

Thomas Gummerer <t.gummerer@gmail.com> writes:

> It will also check the contents if the mtime is greater than the
> timestamp of the index, so the 'touch' here would also cover that.
>
> So the changes here do solve the race completely.

OK, the explanation makes sense.

Either test.r has been correctly checked out and has an older
timestamp or a more recent timestamp. In the former case, the index
knows that we did not touch it, so the next "checkout" knows it does
not have to ask the clean filter to work on it.  In the latter case,
the index is unsure if we touched it (or, suspects that it has
updated contents in it), so the clean filter needs to read from the
working tree to see if we did change it (and we find it is not
modified).  The outcome at the higher level, the answer to the
question "checkout" wanted to ask, is the same: test.r has no local
modificaiton and we can switch branches safely.

And that is already validated by seeing what exit status "checkout"
gives us, so it sort-of feels to be testing a bit too low level
implementation detail to see on which paths the filters are or are
not called, but that is not a problem with this fix.  If we want to
check at that level, we should do so correctly, and making sure that
the test.r file has recent timestamp to convince "checkout" that it
needs to verify contents is the right thing to do.

Thanks.

  reply	other threads:[~2019-08-21 15:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20  6:56 [PATCH] t0021: make sure clean filter runs Thomas Gummerer
2019-08-20 18:01 ` Junio C Hamano
2019-08-21 14:52   ` Thomas Gummerer
2019-08-21 15:40     ` Junio C Hamano [this message]
2019-08-20 19:11 ` Johannes Sixt
2019-08-21 14:56   ` Thomas Gummerer
2019-08-21 18:23     ` Johannes Sixt
2019-08-21 22:03       ` SZEDER Gábor
2019-08-22 17:49         ` Thomas Gummerer
2019-08-22 18:04           ` Junio C Hamano
2019-08-22 18:52           ` Johannes Sixt
2019-08-22 19:22 ` [PATCH v2] " Thomas Gummerer
2019-08-22 20:01   ` Junio C Hamano
2019-08-23  8:34   ` SZEDER Gábor

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqq36huttku.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=larsxschneider@gmail.com \
    --cc=rsbecker@nexbridge.com \
    --cc=szeder.dev@gmail.com \
    --cc=t.gummerer@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).