Re: Tracking empty directories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/01/2011 09:54 PM, Nguyen Thai Ngoc Duy wrote:
On Wed, Feb 2, 2011 at 2:03 AM, Jakub Narebski<jnareb@xxxxxxxxx>  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>.

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?

That's what I do now... in fact, since the empty directory needs to exist in checkouts *and* be empty, adding a .gitignore file with content '*' works quite well.

--
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kfleming@xxxxxxxxxx
Check us out at www.digium.com & www.asterisk.org
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]