Re: git grep: search whole tree by default?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 23, 2013, 17:23 UTC
- Message-ID
- <xmqqmwlzrjdh.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <vpqbo2guff7.fsf@anie.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 10 quoted lines
> In summary: changing is painful. The case of "git add" was really bad, > since the same command had different behavior depending on the options > given, so it was clearly worth the pain. In the case of "git grep", the > current behavior is not _that_ bad, so nobody bothered to do the change. > > (by "do the change", I mean propose a migration plan, convince people > that it is good, ...) > > I'd personally be slightly in favor of changing to tree-wide, but > without strong opinion.
After reading that old thread again, I tend to think that the only reason to favor "git grep" to start at the $(cwd) is the backward compatibility. While I do expect that many people will be annoyed when "git grep" (no pathspecs) that is run in a subdirectory starts spitting out a large number of hits from places irrelevant for the current task at hand, hits from outside the $(cwd) is something they can _notice_ easily and their fingers will quickly learn to add "." without even thinking.
I suspect that it would be too late for 2.0 we want to do sometime early next year, though.