"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
Re: got diff vs .gitignore
To:
Stefan Sperling <stsp@stsp.name>
Cc:
gameoftrees@openbsd.org
Date:
Thu, 10 Feb 2022 17:25:35 +0100

Download raw body.

Thread
Stefan Sperling <stsp@stsp.name> writes:

> On Thu, Feb 10, 2022 at 04:59:38PM +0100, Omar Polo wrote:
>> just a curiosity: there's a reason to delay the ignore check after the
>> lstat and not just after got_fileindex_entry_get?  My reasoning is that
>> if got_fileindex_entry_get doesn't find anything then the file is not in
>> the repository and we can honour the `no_ignore' flag without even
>> caring to stat it.  (I'm not familiar enough with how the worktree is
>> managed thought, so I'm probably missing something)
>
> There are some status consumers which look for the NONEXISTENT status
> value, such as 'got rm' (deleting a non-existent file is a no-op).
> If we skip the stat call then the status walk cannot provide NONEXISTENT,
> and such consumers would then have similar issues like the one you found
> in 'got diff'.

Thanks for the explanation, I have not thought about that possibility.

(just for the record, the regress tests passed with the ignore check
moved before lstat, that's why I asked.)