All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Gary Wilson <gary.wilson@of-networks.co.uk>
Cc: git@vger.kernel.org
Subject: Re: Unexpected empty directory removal
Date: Thu, 12 Apr 2012 11:32:26 -0700	[thread overview]
Message-ID: <7vehrs6bt1.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4F870C04.9060304@of-networks.co.uk> (Gary Wilson's message of "Thu, 12 Apr 2012 18:08:20 +0100")

Gary Wilson <gary.wilson@of-networks.co.uk> writes:

> Use case to replicate:
>
> 1. Have path/files/a.file exists (and/or path/files/*) on client A and
> client B
> 2. Remove the physical files from the path/files/ directory on client A,
> so that the directory is empty
> 3. git commit
> 4. git pull on client B
> 5. On client A an empty path/files/ directory exists on client B it has
> been removed, meaning path/files/ no longer exists.
>
> Is this the expected behaviour?

As Git does not track directories at all, but merely uses directories as a
means to instantiate files (which it tracks), when the last file is
removed as the result of a merge in repository B, it notices that the
directory is no longer needed to hold anything it cares about, and removes
it.

If you ran "git rm path/files/a.file" in repository A to remove the last
file in the directory may also remove the now-empty directory (I do not
remember offhand if it does), which is also expected.

  reply	other threads:[~2012-04-12 18:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-12 17:08 Unexpected empty directory removal Gary Wilson
2012-04-12 18:32 ` Junio C Hamano [this message]
2012-04-12 19:11   ` Gary Wilson

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=7vehrs6bt1.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=gary.wilson@of-networks.co.uk \
    --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.