All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Calvin Taylor <coolcatt@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Bug Report: git ls-files -d
Date: Mon, 27 Sep 2021 14:21:44 -0700	[thread overview]
Message-ID: <xmqqtui5ogt3.fsf@gitster.g> (raw)
In-Reply-To: <CAP9BFHVdg_BWZ2wvdv8t-mN3WKjW4fA+v2181WRYQGsrgmvKmA@mail.gmail.com> (Calvin Taylor's message of "Mon, 27 Sep 2021 10:36:24 -0300")



    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.

      reply	other threads:[~2021-09-27 21:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-27 13:36 Bug Report: git ls-files -d Calvin Taylor
2021-09-27 21:21 ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqtui5ogt3.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=coolcatt@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.