Thread (1 message) 1 message, 1 author, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:02

Marco Costalba [off-list ref] 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help