threads / bug / 15165

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

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

## tl;dr

2 messages between Aug 22, 2008 and Aug 22, 2008.

replies: 1people: 2as markdown or json

Girish Ramakrishnan· Aug 22, 2008, 15:59 UTC · lore

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)?

Girish
Michael J Gruber· Aug 22, 2008, 16:49 UTC · re: Girish Ramakrishnan · lore

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

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

← back to recent threads