git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] t0021: make sure clean filter runs

From
Thomas Gummerer <t.gummerer@gmail.com>
Date
Aug 21, 2019, 14:52 UTC
Message-ID
<20190821145215.GA2679@cat>
In-Reply-To
<xmqqlfvnvhpl.fsf@gitster-ct.c.googlers.com>
On 08/20, Junio C Hamano wrote:
Show 12 quoted lines
> Thomas Gummerer <t.gummerer@gmail.com> writes:
> 
> > Fix the test by updating the mtime of test.r, so git is forced to
> > check the contents of the file, and the clean filter is run as the
> > test expects.
> 
> Hmph, depending on the timestamp granularity, with this patch,
> test.r would have mtime that is the same or a bit later than that of
> the index file.  Is it sufficient to really "force" Git to check the
> contents, or does it just make the likelyhood that it would choose
> to check a bit bigger (in other words, are we solving the race, or
> merely making the race window smaller)?

This test only worked until now because git checks the contents if the mtime of the file and the index are the same. This is because of racy-git. I tried to describe this in the commit message, but looks like it wasn't clear enough. Do you have any suggestions on how to make it clearer?

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.
Show 20 quoted lines
> Thanks.
> 
> >
> > Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
> > ---
> >  t/t0021-conversion.sh | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
> > index e10f5f787f..66f75005d5 100755
> > --- a/t/t0021-conversion.sh
> > +++ b/t/t0021-conversion.sh
> > @@ -390,6 +390,7 @@ test_expect_success PERL 'required process filter should filter data' '
> >  		EOF
> >  		test_cmp_exclude_clean expected.log debug.log &&
> >  
> > +		touch test.r &&
> >  		filter_git checkout --quiet --no-progress empty-branch &&
> >  		cat >expected.log <<-EOF &&
> >  			START
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 14 in “t0021: make sure clean filter runs”
  1. t0021: make sure clean filter runsThomas Gummerer, Aug 20, 2019
  2. Junio C HamanoAug 20, 2019
  3. Thomas GummererAug 21, 2019
  4. Junio C HamanoAug 21, 2019
  5. Johannes SixtAug 20, 2019
  6. Thomas GummererAug 21, 2019
  7. Johannes SixtAug 21, 2019
  8. SZEDER GáborAug 21, 2019
  9. Thomas GummererAug 22, 2019
  10. Junio C HamanoAug 22, 2019
  11. Johannes SixtAug 22, 2019
  12. t0021: make sure clean filter runsThomas Gummerer, Aug 22, 2019
  13. Junio C HamanoAug 22, 2019
  14. SZEDER GáborAug 23, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.