Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: [PATCH] ls-files: fix overeager pathspec optimization

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:47:59

Possibly related (same subject, not in this thread)


On Fri, 8 Jan 2010, Junio C Hamano wrote:
Yes, and the previous patch wasn't adding what is ignored to the array, so
here is a re-roll to fix that in addition to the fix to "should the loop
start from checking an empty path?" issue you noticed.
Ack. Looks ok to me, and I think it's a lot more obvious.
But I am starting to wonder if we might be better off restructuring
read_directory_recursive().  Currently it assumes that the path it was
given _must_ be of interest (i.e. not ignored) and runs excluded() on
subdirectories it finds to make that same decision before recursing into
them or skipping them.  It might make more sense if it first checked if
the path given by the caller should be ignored and act accordingly.
Hmm. I can't make myself care one way or the other, I have to admit.  I 
assume you mean basically taking the path and using the first component of 
it _instead_ of doing a readdir() - and getting rid of the simplification 
up front?

I agree that that should work. Would it be simpler and cleaner? Perhaps. 
I'd have to see both patches to be able to tell. I do admit that while I 
acked your patch, it sure ain't _pretty_ to do that special odd 
"has_leading_ignored_dir()" thing.

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