From: Junio C Hamano Date: Mon, 25 Jul 2005 22:06:18 GMT Subject: Re: [RFC] extending git-ls-files --exclude. Message-ID: <7vll3uh76t.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <20050725213456.23910.qmail@web26310.mail.ukl.yahoo.com> Marco Costalba writes: > This cumulative effect brakes local scoping of .gitignore files in > corresponding subdirectory. > > As example in a directory A we can have a .gitignore file with > > !foo.html > *.html > > because we want to special case 'that' foo.html in 'that' > directory. I guess that !foo.html I wrote was a bad example of special case not being specific enough. Saying "!/foo.html" should work [*1*], so I think "cumulative effect _breaks_" is a bit too strong a word. Having said that,... > This can be powerful and flexible but also prone to errors. While I also suspect it _might_ be prone to user errors, at least to some classes of users, Catalin (and Peter as well I suspect, although I may be mistaken by what he originally meant by "cumulative") seems to think it is OK. As a developer of another Porcelain (qgit), your input is as valuable as others, so... BTW, I am CC'ing git list because I saw you forwarded your entire message to the list as a quoted message form. Please do not do that. I cannot distinguish a message like that with a message with nothing but quote and no original contents, which I normally discard without even reading. [Footnote] *1* I just tried, and it seems to work. $ rm -f .gitignore ppc/.gitignore $ (echo '!/foo.bar'; echo '*.bar') >.gitignore $ for i in foo.bar baz.bar; do date >$i; date >ppc/$i; done $ git-ls-files --others --exclude-per-directory=.gitignore | grep '\.bar' foo.bar $ rm -f .gitignore ppc/.gitignore