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

Re: git grep: search whole tree by default?

From
Duy Nguyen <pclouds@gmail.com>
Date
Oct 25, 2013, 04:52 UTC
Message-ID
<CACsJy8Cm7eShj22hve7=u2K5DKhv-t_KNUreRC+FZoehgfyEkg@mail.gmail.com>
In-Reply-To
<20131025043717.GC11810@sigill.intra.peff.net>
On Fri, Oct 25, 2013 at 11:37 AM, Jeff King <peff@peff.net> wrote:
Show 20 quoted lines
> On Thu, Oct 24, 2013 at 12:40:44PM -0700, Junio C Hamano wrote:
>
>> Jeff King <peff@peff.net> writes:
>>
>> > That would also provide people who do not like the change of default an
>> > escape hatch to keep the current behavior. And I do not think scripted
>> > use will be inconvenienced; they will already have to use "." or ":/" to
>> > be explicit (if they care) since the behavior is changing.
>>
>> There is a big difference between "scripted use will have an escape
>> hatch" and "scripted use will not be inconvenienced".
>
> I think my communication may have been muddled in transit. What I meant
> regarding inconvenienced was "not any more so than by simply changing
> the behavior in the first place, since scripts already will need to
> start becoming explicit due to the behavior change".
>
> And for the "escape hatch", I did not mean for scripts. I actually meant
> for users who do not like the extra typing and complain "stupid git, I
> always want '.'; you used to do what I want and now you do not".

Such an escape hatch may be better done as an alias than a config key (an alias is a config key anyway). I know it won't be easy to "add '.' if no pathspecs are given", using shell script. But that's something we could improve, hopefully. An option is we could just export PATHSPEC_PREFER_* flags via a command line (like --literal-pathspecs).

-- 
Duy
Previous: Jeff King
Message 14 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.