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

Re: [BUG?] ls-files -d does not show files removed using 'git rm'

From
Michael J Gruber <michaeljgruber+gmane@fastmail.fm>
Date
Aug 22, 2008, 16:49 UTC
Message-ID
<g8mqnf$ncv$1@ger.gmane.org>
In-Reply-To
<48AEE261.8070906@forwardbias.in>
Girish Ramakrishnan venit, vidit, dixit 22.08.2008 17:59:
Show 14 quoted lines
> If I remove a file using the shell rm, it is listed by ls-files -d.
> However, it is not listed if I use 'git rm'.
> 
> $ rm foo
> $ git ls-files -t -d
> R foo
> $ git checkout foo
> $ git rm foo
> rm 'foo'
> $ git ls-files -t -d
> $
> 
> Is this a bug? In any case, is there a way to find out what files have
> been removed using git rm using ls-files (git status does show it)?

git ls-files combines the listing from the index with the listing from the workdir. A git rm'ed file is present in neither.

git diff --cached --name-only --diff-filter=D
would show all files which are staged for deletion (git rm'ed).
Michael
Previous: Girish Ramakrishnan
Message 2 of 2 in “[BUG?] ls-files -d does not show files removed using 'git rm'”
  1. Girish RamakrishnanAug 22, 2008
  2. Michael J GruberAug 22, 2008

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.