* git-grep: small suggestion, -w flag
@ 2009-02-22 10:34 Ingo Molnar
2009-02-22 11:15 ` René Scharfe
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2009-02-22 10:34 UTC (permalink / raw)
To: git
Here's a stupid little git-grep suggestion.
I recently transitioned from the use of egrep to git-grep, and i
like it very much (it nicely excludes build related files,
etc.), but there's one small detail: the lack of the -w flag.
It's equivalent to this pattern:
git grep '\<tick_length\>'
And it's the most common grep flag i (and i suspect many others)
use, in addition to the (already supported) -l flag.
When grepping for symbols in a large repository (such as the
Linux kernel) -w is very common and very useful - there's many
similar symbols, variants of each other. I use it when seeing a
symbol in an oops, etc.
While i realize that git-grep does not want to be a full grep
replacement, there's a real usability difference between having
to type:
git grep '\<schedule\>'
git grep -w schedule
(especially since backslash is a seldom used key during a normal
workflow, so accessing it is often a small mental hickup.)
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git-grep: small suggestion, -w flag
2009-02-22 10:34 git-grep: small suggestion, -w flag Ingo Molnar
@ 2009-02-22 11:15 ` René Scharfe
2009-02-22 16:14 ` Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: René Scharfe @ 2009-02-22 11:15 UTC (permalink / raw)
To: Ingo Molnar; +Cc: git
Ingo Molnar schrieb:
> Here's a stupid little git-grep suggestion.
>
> I recently transitioned from the use of egrep to git-grep, and i
> like it very much (it nicely excludes build related files,
> etc.), but there's one small detail: the lack of the -w flag.
git grep knows this flag since version 1.4.1. Does it do something
different from egrep's?
René
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git-grep: small suggestion, -w flag
2009-02-22 11:15 ` René Scharfe
@ 2009-02-22 16:14 ` Ingo Molnar
2009-02-22 17:20 ` Miklos Vajna
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2009-02-22 16:14 UTC (permalink / raw)
To: René Scharfe; +Cc: git
* René Scharfe <rene.scharfe@lsrfire.ath.cx> wrote:
> Ingo Molnar schrieb:
> > Here's a stupid little git-grep suggestion.
> >
> > I recently transitioned from the use of egrep to git-grep, and i
> > like it very much (it nicely excludes build related files,
> > etc.), but there's one small detail: the lack of the -w flag.
>
> git grep knows this flag since version 1.4.1. Does it do
> something different from egrep's?
ah:
earth4:~/tip> git grep -lw schedule
usage: git grep <option>* [-e] <pattern> <rev>* [[--] <path>...]
should have been 'git grep -l -w schedule'.
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git-grep: small suggestion, -w flag
2009-02-22 16:14 ` Ingo Molnar
@ 2009-02-22 17:20 ` Miklos Vajna
2009-02-22 17:23 ` Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: Miklos Vajna @ 2009-02-22 17:20 UTC (permalink / raw)
To: Ingo Molnar; +Cc: René Scharfe, git
[-- Attachment #1: Type: text/plain, Size: 374 bytes --]
On Sun, Feb 22, 2009 at 05:14:10PM +0100, Ingo Molnar <mingo@elte.hu> wrote:
> earth4:~/tip> git grep -lw schedule
> usage: git grep <option>* [-e] <pattern> <rev>* [[--] <path>...]
>
>
> should have been 'git grep -l -w schedule'.
Yeah, that's because git-grep does not use parseopt yet.
I'm willing to work on it once mv/parseopt-ls-files is settled down.
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git-grep: small suggestion, -w flag
2009-02-22 17:20 ` Miklos Vajna
@ 2009-02-22 17:23 ` Ingo Molnar
0 siblings, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2009-02-22 17:23 UTC (permalink / raw)
To: Miklos Vajna; +Cc: René Scharfe, git
* Miklos Vajna <vmiklos@frugalware.org> wrote:
> On Sun, Feb 22, 2009 at 05:14:10PM +0100, Ingo Molnar <mingo@elte.hu> wrote:
> > earth4:~/tip> git grep -lw schedule
> > usage: git grep <option>* [-e] <pattern> <rev>* [[--] <path>...]
> >
> >
> > should have been 'git grep -l -w schedule'.
>
> Yeah, that's because git-grep does not use parseopt yet.
>
> I'm willing to work on it once mv/parseopt-ls-files is settled
> down.
As long as it's planned eventually i'm a happy camper! No rush.
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-02-22 17:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-22 10:34 git-grep: small suggestion, -w flag Ingo Molnar
2009-02-22 11:15 ` René Scharfe
2009-02-22 16:14 ` Ingo Molnar
2009-02-22 17:20 ` Miklos Vajna
2009-02-22 17:23 ` Ingo Molnar
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).