Subject: Re: Tracking empty directories

From: Jakub Narebski <[email-masked]>
Date: Tue, 1 Feb 2011 20:03:46 +0100

Dnia wtorek 1. lutego 2011 19:35, Jonathan Nieder napisał:
> Nguyen Thai Ngoc Duy wrote:
>> On Wed, Feb 2, 2011 at 12:28 AM, Jonathan Nieder <[email-masked]> wrote:
> 
>>> I have ideas about how to resolve those tricky corner cases, but not
>>> about what the UI should look like.  How does one go about adding a
>>> directory?  Does it ever get implicitly removed?
>>
>> I suppose a special command for it is appropriate (git-keepdir?). Many
>> index-related commands are recursive by default and hard to change.
>>
>> Yes I think it should be automatically removed from index when a file
>> is added inside tracked directories. Removing those files will also
>> remove the containing directory though.
> 
> Okay, I'm convinced.  This fits a "worse is better" point of view
> nicely.
> 
> To add, one would use "git update-index --add".

Porcelain version could be "git add -N <directory>", don't you agree?

> The magic disappears when you register a file within that directory;
> to tell git you want to keep it, one would mkdir and
> "git update-index --add" again.  Once it's working, we can think about
> if there is a need for making that last step automatic after all
> (my guess: "no"). ;-) 

Hmmm... could we use mechanism similar to assume-unchanged to mark
directory as explicitely tracked, and that git should not remove it
when it becomes empty?

-- 
Jakub Narebski
Poland