Thread (1 message) 1 message, 1 author, 2021-09-27

Re: Bug Report: git ls-files -d

From: Junio C Hamano <hidden>
Date: 2021-09-27 21:21:50


    What did you expect to happen? (Expected behavior)
    git ls-files -d to show deleted files in my repository

    What happened instead? (Actual behavior)
    nothing is shown

Does not reproduce to me.

    $ git reset --hard
    $ git ls-files -s COPYING
    100644 536e55524db72bd2acf175208aef4f3dfc148d42 0	COPYING
    $ ls -1 COPYING
    COPYING
    $ git ls-files -d; echo no output
    no output
    $ rm COPYING
    $ git ls-files -d
    COPYING

Did you remove any file?  "ls-files -d" reports the working tree
files that have been removed that are still known by the index.
So, after all of the above

    $ git rm --cached COPYING
    $ git ls-files -d; echo no output
    no output

is perfectly expected.

Unlike "git ls-files" that checks the working files against what is in
the index, "git status" checks them against both the index and the
HEAD, so after all of the above, it would notice the removal
relative to HEAD:

    $ git status -uno --porcelain
    D  COPYING

HTH.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help