Re: [PATCH] built-in "git grep" (git grip).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Tue, 2 May 2006, Junio C Hamano wrote:
> 
> On a related tangent, ever since I started using the built-in
> grep with ls-files like wildcard, I find myself typing something
> like this by mistake (this is from my day-job work project that
> has src/mx.js and src/mxstyle.css among other things):
> 
> 	git diff 268a94 -- 'src/mx*'
> 
> I am tempted to suggest switching pathspecs used by diff and log
> family to do the same wildcarding, perhaps after tightening the
> wildcard vs directory prefix logic used in the builtin-grep of
> the current "next" tip, which is a bit looser than necessary.

Yeah, the wildcarding is nice. You need to be very careful about it, 
though, to make sure that you take full advantage of the path 
component optimizations _before_ the wildcards, so that when you do 
something like the above ('src/mx*'), you do the "src/" part with the 
tree-level optimizations, and only the latter part with the pattern 
matching (because you do _not_ want to expand the whole tree when you 
don't want to).

That "ls-files.c" thing already does part of this (that whole "prefix_len" 
thing for the "longest common prefix").

		Linus
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]