Re: Tracking empty directories
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Feb 2, 2011, 03:54 UTC
- Message-ID
- <AANLkTikkymYmnXh7XB1SM8br_oK-YmAJYfkwjTuLzr+f@mail.gmail.com>
- In-Reply-To
- <201102012003.50941.jnareb@gmail.com>
On Wed, Feb 2, 2011 at 2:03 AM, Jakub Narebski <jnareb@gmail.com> wrote:
>> To add, one would use "git update-index --add". > > Porcelain version could be "git add -N <directory>", don't you agree?
"git add" is recursive, with or without -N. What I worry is user accidentally "git add -N <dir>" where <dir> is not empty, which adds everything in <dir>.
Show 9 quoted lines
>> 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?
I think git-attr suits better, more persistent. Although if you insist the directory must stay, why not just put a hidden file in there?
-- Duy