From: Linus Torvalds <torvalds@osdl.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] built-in "git grep" (git grip).
Date: Tue, 2 May 2006 16:07:45 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0605021603050.4086@g5.osdl.org> (raw)
In-Reply-To: <7vbqugks8j.fsf@assigned-by-dhcp.cox.net>
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
next prev parent reply other threads:[~2006-05-02 23:08 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-01 6:32 [PATCH] built-in "git grep" (git grip) Junio C Hamano
2006-05-01 6:56 ` Jakub Narebski
2006-05-01 6:59 ` Junio C Hamano
2006-05-01 7:12 ` Jakub Narebski
2006-05-02 8:33 ` Andreas Ericsson
2006-05-02 8:44 ` Jakub Narebski
2006-05-02 9:01 ` Junio C Hamano
2006-05-02 9:25 ` Jakub Narebski
2006-05-02 9:39 ` Andreas Ericsson
2006-05-02 19:07 ` Junio C Hamano
2006-05-02 21:23 ` Linus Torvalds
2006-05-02 21:54 ` Junio C Hamano
2006-05-02 23:07 ` Linus Torvalds [this message]
2006-05-03 0:01 ` Junio C Hamano
2006-05-01 7:30 ` [PATCH] built-in "git grep" (git grip) - quickfix Junio C Hamano
2006-05-01 14:04 ` [PATCH] built-in "git grep" (git grip) Sam Ravnborg
2006-05-01 14:07 ` Sam Ravnborg
2006-05-01 14:53 ` Sam Ravnborg
2006-05-01 15:48 ` Linus Torvalds
2006-05-01 19:30 ` [PATCH] builtin-grep: wildcard pathspec fixes Junio C Hamano
2006-05-01 23:24 ` [PATCH] builtin-grep: do not use setup_revisions() Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0605021603050.4086@g5.osdl.org \
--to=torvalds@osdl.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).