git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git grep: search whole tree by default?
@ 2013-10-23  8:25 Piotr Krukowiecki
  2013-10-23 16:21 ` Matthieu Moy
  0 siblings, 1 reply; 14+ messages in thread
From: Piotr Krukowiecki @ 2013-10-23  8:25 UTC (permalink / raw)
  To: Git Mailing List

Hi,

it would be nice if grep searched not only in current directory and
subdirectories, but in whole tree.

I know I can use ":/" as a pathspec, but since most git commands work
tree, I got used to this and forgot that grep is different.

It's easy to make a mistake and believe that your code does not
contain searched string XXX - because you have searched from a
subdirectory, not from the top level of your working tree. OTOH, if
grep searches whole tree, you'll notice you get results from outside
of CWD and if you don't want that, you will be able to limit the
search to '.'

I think there were discussion about how there are several git commands
which do not search in whole tree by default and that it's going to be
changed. I think "add" is one of such commands. Is 'grep' left
unchanged?

Last discussion I found is from 2011 March
(http://thread.gmane.org/gmane.comp.version-control.git/168063/focus=168188)
and it says it's not going to be changed :(

-- 
Piotr Krukowiecki

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

end of thread, other threads:[~2013-10-25  4:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-23  8:25 git grep: search whole tree by default? Piotr Krukowiecki
2013-10-23 16:21 ` Matthieu Moy
2013-10-23 17:23   ` Junio C Hamano
2013-10-23 18:20     ` Jed Brown
2013-10-23 18:52       ` Junio C Hamano
2013-10-23 19:24         ` Jed Brown
2013-10-23 19:31           ` Junio C Hamano
2013-10-24  2:15             ` David Aguilar
2013-10-23 20:43           ` Matthieu Moy
2013-10-24  2:27             ` Jeff King
2013-10-24 19:40               ` Junio C Hamano
2013-10-25  2:23                 ` David Aguilar
2013-10-25  4:37                 ` Jeff King
2013-10-25  4:52                   ` Duy Nguyen

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