git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git grep and word boundaries
@ 2008-05-27  8:35 Thomas Volpini
  2008-05-27  8:56 ` Luciano Rocha
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Volpini @ 2008-05-27  8:35 UTC (permalink / raw)
  To: git

Hello,

it seems that git grep doesn't do word boundaries as described:

$ cat bar
foo bar baz
$ grep "\<bar\>" *
foo bar baz
$ git grep "\<bar\>" *
$ git grep -w "\<bar\>" *
$ git grep -w "bar" *
bar:foo bar baz
$ git grep -E "\<bar\>" *
$ git grep -E "\bbar\b" *
$

thanks,
Thomas

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: git grep and word boundaries
  2008-05-27  8:35 git grep and word boundaries Thomas Volpini
@ 2008-05-27  8:56 ` Luciano Rocha
  0 siblings, 0 replies; 2+ messages in thread
From: Luciano Rocha @ 2008-05-27  8:56 UTC (permalink / raw)
  To: Thomas Volpini; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 720 bytes --]

On Tue, May 27, 2008 at 10:35:46AM +0200, Thomas Volpini wrote:
>  Hello,
> 
>  it seems that git grep doesn't do word boundaries as described:
> 
>  $ cat bar
>  foo bar baz
>  $ grep "\<bar\>" *
>  foo bar baz
>  $ git grep "\<bar\>" *
>  $ git grep -w "\<bar\>" *
>  $ git grep -w "bar" *
>  bar:foo bar baz
>  $ git grep -E "\<bar\>" *
>  $ git grep -E "\bbar\b" *
>  $

It works here. Did you add the file?
$ grep "\<bar\>" *
foo bar baz
$ git grep "\<bar\>"
bar:foo bar baz
$ git grep "\<bar\>" *
bar:foo bar baz
$ git grep \\bbar\\b
bar:foo bar baz
$ git grep \\bbar\\b *
bar:foo bar baz

-- 
Luciano Rocha <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-27  8:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-27  8:35 git grep and word boundaries Thomas Volpini
2008-05-27  8:56 ` Luciano Rocha

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).