Re: [PATCH] test overlapping ignore patterns

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] test overlapping ignore patterns

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:51:33

Stephen Haberman [off-list ref] writes:
+test_expect_success 'negated exclude matches can override previous ones 2'
'
+
+ git ls-files --others --exclude="*" --exclude="!*.1" >output &&
+ grep "^one/two/a.1" output
+'
Does this has anything to do with "negated overrides"?

Doesn't the first "*" tells us to not to look at the contents of one/
directory at all, so we that we do not have to waste time descending into
it?  We wouldn't even know what pathnames are underneath it, so "!*.1"
would not have any effect inside one/ at all, I think.

Re: [PATCH] test overlapping ignore patterns

From: Stephen Haberman <hidden>
Date: 2016-06-15 22:51:33

Doesn't the first "*" tells us to not to look at the contents of one/
directory at all, so we that we do not have to waste time descending
into it?  We wouldn't even know what pathnames are underneath it, so
"!*.1" would not have any effect inside one/ at all, I think.
If that's the way the feature should work, that's fine.

I came across this thread via google referencing Linus's post from 2008
which mentioned versioning only jpg files. I want to do the same sort of
thing, but with a directory hierarchy.

If I say "exclude *.jpg" in my root .gitignore file, that applies into
sub directories, so I just assumed "exclude !*.jpg" would also apply to
sub directories.

Am I missing another way to accomplish this?

I understand from an implementation perspective, skipping all
subdirectories when you see "exlude *" is a smart thing to do, but
perhaps it should only be done if there are no negative excludes that
could bring items back into play?

Thanks,
Stephen
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help