Re: [BUG] ls-files showing deleted files (unchecked lstat return value)
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 20, 2019, 22:51 UTC
- Message-ID
- <xmqqh8cyul87.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20190218151725.GL1622@szeder.dev>
SZEDER Gábor <szeder.dev@gmail.com> writes:
Show 7 quoted lines
> On Sun, Feb 17, 2019 at 08:49:39AM -0500, Joe Ranieri wrote: >> "git ls-files -m" can show deleted files, despite -d not having been >> specified. > > To my understanding that's intentional: a deleted file is considered > modified, because its content clearly doesn't match the tracked > content.
Hmph, I am not so sure about that.
It seems that b0391890 ("Show modified files in git-ls-files", 2005-09-19) fixes one of its draft version's bugs in "http://public-inbox.org/git/43179E59.80106@didntduck.org/" by not letting it use ce_match_stat() directly, but introducing ce_modified() that inspects the data for actual changes. The effort however did not spot the other bug, namely, lstat() returning an error for ENOENT.
I think the original intent was for "ls-files -d", "ls-files -m" and "ls-files -d m" all can be used in a meaningful way by keeping these two selectors independent. The buggy implementation did not realize that intent correctly, though.