git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git-grep: small suggestion, -w flag

From
IMIngo Molnar <mingo@elte.hu>
Date
Feb 22, 2009, 10:34 UTC
Message-ID
<20090222103448.GA32119@elte.hu>
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
Next: René Scharfe
Message 1 of 5 in “git-grep: small suggestion, -w flag”
  1. Ingo MolnarFeb 22, 2009
  2. René ScharfeFeb 22, 2009
  3. Ingo MolnarFeb 22, 2009
  4. Miklos VajnaFeb 22, 2009
  5. Ingo MolnarFeb 22, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.