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

Re: git grep: search whole tree by default?

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Oct 23, 2013, 20:43 UTC
Message-ID
<vpqy55jogzr.fsf@anie.imag.fr>
In-Reply-To
<87zjpzg592.fsf@mcs.anl.gov>
Jed Brown <jed@59A2.org> writes:
Show 20 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Jed Brown <jed@59A2.org> writes:
>>
>>> Junio C Hamano <gitster@pobox.com> writes:
>>>> I suspect that it would be too late for 2.0 we want to do sometime
>>>> early next year, though.
>>>
>>> How would you manage transition from the current behavior?  Warning
>>> people to explicitly use "." or ":/" during some interim period sounds
>>> worse than just switching the default behavior.
>>
>> "How would I"?
>>
>> You're asking that question only because you omitted too much from
>> the quote ;-)
>
> I meant that if the proposed migration plan were to be "just change it
> and people will learn" (because anything more gradual would actually be
> worse for users) then is it really too late for Git-2.0?

That may be an option. In the case of "git add -u", it was a bit more complicated, since a badly used "git add" somehow looses data (not very serious, you may only loos the index). So, saying after the fact "oh, by the way, I messed up the index" was not a very good transition plan.

In the case of "grep", I'm starting to get convinced that it's OK to do so, because the user can basically re-run grep with the right argument if needed.

The warning could be de-activable with an advice.* option.
Again, no strong opinion here, but that seems workable to me.
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: David AguilarNext: Jeff King
Message 9 of 14 in “git grep: search whole tree by default?”
  1. Piotr KrukowieckiOct 23, 2013
  2. Matthieu MoyOct 23, 2013
  3. Junio C HamanoOct 23, 2013
  4. Jed BrownOct 23, 2013
  5. Junio C HamanoOct 23, 2013
  6. Jed BrownOct 23, 2013
  7. Junio C HamanoOct 23, 2013
  8. David AguilarOct 24, 2013
  9. Matthieu MoyOct 23, 2013
  10. Jeff KingOct 24, 2013
  11. Junio C HamanoOct 24, 2013
  12. David AguilarOct 25, 2013
  13. Jeff KingOct 25, 2013
  14. Duy NguyenOct 25, 2013

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.