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

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.

Previous: Randall S. Becker
Message 6 of 6 in “[BUG] ls-files showing deleted files (unchecked lstat return value)”
  1. Joe RanieriFeb 17, 2019
  2. Randall S. BeckerFeb 17, 2019
  3. Joe RanieriFeb 18, 2019
  4. SZEDER GáborFeb 18, 2019
  5. Randall S. BeckerFeb 18, 2019
  6. Junio C HamanoFeb 20, 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.