All of lore.kernel.org
 help / color / mirror / Atom feed
* Unexpected empty directory removal
@ 2012-04-12 17:08 Gary Wilson
  2012-04-12 18:32 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Gary Wilson @ 2012-04-12 17:08 UTC (permalink / raw)
  To: git

Hi

I do not normally report things such as this and they are usually
"features", however this one seems overly strange to me as directories
and files are different things and I would expected a source code
versioning system to adhere to that.

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 if it is, I will definitely bear
that in mind and note that git will not make empty directories AND will
remove empty directories from all clients apart from the client that
emptied the directory.

client A: git version 1.7.0.4
client B: git version 1.7.1
git server: whatever github.com is running

Regards
Gary

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unexpected empty directory removal
  2012-04-12 17:08 Unexpected empty directory removal Gary Wilson
@ 2012-04-12 18:32 ` Junio C Hamano
  2012-04-12 19:11   ` Gary Wilson
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2012-04-12 18:32 UTC (permalink / raw)
  To: Gary Wilson; +Cc: git

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unexpected empty directory removal
  2012-04-12 18:32 ` Junio C Hamano
@ 2012-04-12 19:11   ` Gary Wilson
  0 siblings, 0 replies; 3+ messages in thread
From: Gary Wilson @ 2012-04-12 19:11 UTC (permalink / raw)
  To: git

Thanks for the clarification and verification of that expected behaviour
Junio.  I shall keep this in mind.

Regards
Gary

On 12/04/12 19:32, Junio C Hamano wrote:
> 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.
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-12 19:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-12 17:08 Unexpected empty directory removal Gary Wilson
2012-04-12 18:32 ` Junio C Hamano
2012-04-12 19:11   ` Gary Wilson

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.