From: Junio C Hamano <gitster@pobox.com>
To: Eunsuk Kang <eskang@csail.mit.edu>
Cc: git@vger.kernel.org
Subject: Re: git rm bug?
Date: Wed, 30 Oct 2013 12:01:12 -0700 [thread overview]
Message-ID: <xmqqob66bn2f.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <155154AA-15E8-49E8-8261-6295AC6F6CF7@csail.mit.edu> (Eunsuk Kang's message of "Wed, 30 Oct 2013 01:23:29 -0400")
Eunsuk Kang <eskang@csail.mit.edu> writes:
> My understanding was that running "git rm" on a file will delete
> all ancestors of the file that are empty directories from the file
> system.
Not really.
We do recurse up to see if a/b/ and then a/ has become a useless
empty directory when we did remove a/b/c from the working tree, but
when we did not have to remove a/b/c (because you have already
removed it), we assume that you know what you are doing and do
nothing to the leading directories.
This behaviour is not because we suspect that you might want to
retain a/ or a/b/; it is just we do not even bother. So it is
entirely plausible that a patch to actually bother checking the
leading directories to see if they have become or they already were
empty directories and remove them, if done cleanly, may be a welcome
change. At least, that would make things consistent between the
cases where you have already manually removed the file a/b/c on the
working tree and where the command removed in response to your
direct request to remove the same file a/b/c.
prev parent reply other threads:[~2013-10-30 19:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-30 5:23 git rm bug? Eunsuk Kang
2013-10-30 19:01 ` 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=xmqqob66bn2f.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=eskang@csail.mit.edu \
--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.