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

Re: git-prompt.sh incompatible with non-basic global grep.patternType

From
Jeff King <peff@peff.net>
Date
Jul 22, 2016, 19:28 UTC
Message-ID
<20160722192811.GA18079@sigill.intra.peff.net>
In-Reply-To
<xmqqr3ala37o.fsf@gitster.mtv.corp.google.com>
On Fri, Jul 22, 2016 at 12:21:31PM -0700, Junio C Hamano wrote:
Show 23 quoted lines
> One thing that I noticed is that there is this strange field
> in grep_opt called .extended_regexp_option; it only is set from the
> boolean configuration grep.extendedregexp and worse yet it takes
> precedence over the command line option or grep.patternType, e.g.
> t7810-grep expects crazy things like these:
> 
>  * "git -c grep.extendedregexp=true -c grep.patterntype=basic grep"
>    wants to be like "git grep -E"
> 
>  * "git -c grep.extendedregexp=false -c grep.patterntype=extended grep"
>    wants to be like "git grep -G"
> 
> This comes from b22520a3 (grep: allow -E and -n to be turned on by
> default via configuration, 2011-03-30) back when we didn't have a
> more generic grep.patternType configuration mechanism in v1.7.5
> days, and it probably need to be deprecated to maintain our sanity.
> I.e. when we see the configuration used, first we warn the user and
> set grep.patternType to extended instead, and then eventually error
> out in a backward-compatibility breaking release of Git we will make
> in some future date, together with things like other compatibility
> breaking topics like ex/deprecate-empty-pathspec-as-match-all.
> 
> But that is a separate topic after this fix goes in anyway.

I am not even sure we need to deprecate it. Once it becomes merely a historical synonym for "grep.patternType=extended" we can live with it indefinitely (and I do not think we need a deprecation period to go there; the existing behavior is simply buggy).

Not that I mind eventually removing it, if you want to go through the steps.

Show 5 quoted lines
> -- >8 --
> From: Junio C Hamano <gitster@pobox.com>
> Date: Fri, 22 Jul 2016 11:43:14 -0700
> Subject: [PATCH] grep: further simplify setting the pattern type
> [...]

Thanks. This matches the cursory analysis I had done earlier, and the patch looks exactly as I had expected.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 14 in “git-prompt.sh incompatible with non-basic global grep.patternType”
  1. Richard SoderbergJul 18, 2016
  2. Johannes SchindelinJul 19, 2016
  3. Richard SoderbergJul 19, 2016
  4. Johannes SchindelinJul 19, 2016
  5. Jeff KingJul 20, 2016
  6. Junio C HamanoJul 20, 2016
  7. Jeff KingJul 20, 2016
  8. Junio C HamanoJul 22, 2016
  9. Jeff KingJul 22, 2016
  10. Junio C HamanoJul 22, 2016
  11. Jeff KingJul 22, 2016
  12. Junio C HamanoJul 22, 2016
  13. Eric SunshineJul 22, 2016
  14. Junio C HamanoJul 25, 2016

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.