Subject: Re: [PATCH] t0008: fix "large exclude file ignored in tree"

From: Mirko Faina <[email-masked]>
Date: Sun, 15 Mar 2026 09:50:06 +0100

On Sat, Mar 14, 2026 at 10:50:42PM -0700, Junio C Hamano wrote:
> > Subject: Re: [PATCH] t0008: fix "large exclude file ignored in tree"
> 
> Strange.  That is clearly not what this patch is touching.
> 
>   Subject: t0008: fix cleanup in 'symlinks not respected in-tree'
> 
> or something?

The test I'm touching is "symlinks not respected in-tree", but the test
failing is "large exclude file ignored in tree". That's why in the
following section it mentions "the previous test".

> > Add cleanup to previous test for file that is unrequired to test the
> > size of the ignored exclude file.
> 
> This description is also inaccurate. It seems to be talking about the
> next test in the file ("large exclude file ignored in tree") rather than
> the one it's actually changing. Worse, the next test does its own
> creation of the "large" .gitignore file and also cleans it up itself,
> so there seem to be no need to fix it, either.
> 
>     The test 'symlinks not respected in-tree' creates a 'subdir'
>     directory and 'subdir/.gitignore' symlink, but only removes the
>     top-level '.gitignore' file in its cleanup.
> 
>     Add 'subdir' to the test_when_finished command to ensure the
>     worktree is properly cleaned up after the test.
> 
> or something, perhaps?

When running "GIT_TEST_OPTS='-l -v' git make t0008-ignores.sh", "large
exclude file ignored in tree" fails with the comparison failing due to
an extra warning "warning: unable to access 'subdir/.gitignore': Too
many levels of symbolic links".

I don't know if this tests fails only on my setup, but seeing that the
failing test is supposed to check for .gitignore size only, the "subdir"
directory is not strictly necessary, without it the test works just
fine.

> This patch has some disturbing characteristics.
> 
> - The subject line and commit message describe a fix for the "large
>   exclude file ignored in tree" test, but the code change actually
>   modifies the "symlinks not respected in-tree" test.
> - The description mentions a file "unrequired to test the size", which
>   doesn't logically apply to the change being made (adding a directory
>   to a cleanup command in a symlink test).
> - This kind of context-mixing (applying a correct fix for one test but
>   attributing it to a neighboring one) is a common pattern in LLM
>   outputs.

Sorry for very bad commit message. When writing it and knowing where the
problem is, I found it obvious. Now reading it again, it doesn't make
sense at all without additional context.

> Is this generated with LLM sent without any sanity-checking by a
> human?

No, this was all hand written. This mess is all due to my incompetency.

> > diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh
> > index db8bde280e..18e048ee8c 100755
> > --- a/t/t0008-ignores.sh
> > +++ b/t/t0008-ignores.sh
> > @@ -946,7 +946,7 @@ test_expect_success SYMLINKS 'symlinks respected in info/exclude' '
> >  '
> >  
> >  test_expect_success SYMLINKS 'symlinks not respected in-tree' '
> > -	test_when_finished "rm .gitignore" &&
> > +	test_when_finished "rm -rf subdir .gitignore" &&
> >  	ln -s ignore .gitignore &&
> >  	mkdir subdir &&
> >  	ln -s ignore subdir/.gitignore &&