git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] extending git-ls-files --exclude.

From
Junio C Hamano <junkio@cox.net>
Date
Jul 25, 2005, 22:06 UTC
Message-ID
<7vll3uh76t.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20050725213456.23910.qmail@web26310.mail.ukl.yahoo.com>
Marco Costalba <mcostalba@yahoo.it> writes:
Show 10 quoted lines
> 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
Message 1 of 1 in “Re: [RFC] extending git-ls-files --exclude.”
  1. Junio C HamanoJul 25, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.