From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Richard Soderberg <rsoderberg@gmail.com>, git@vger.kernel.org
Subject: Re: git-prompt.sh incompatible with non-basic global grep.patternType
Date: Fri, 22 Jul 2016 16:05:45 -0400 [thread overview]
Message-ID: <20160722200545.GA18286@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqa8h9a1uj.fsf@gitster.mtv.corp.google.com>
On Fri, Jul 22, 2016 at 12:51:00PM -0700, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> >> 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 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).
>
> I grossed over an important detail.
>
> Pretending as if grep.patternType=extended were given when we see
> grep.extendedregexp=true and grep.patternType=basic is given when
> grep.extendedregexp=false changes the behaviour in a way that can be
> seen as the violation of (crazy) expectations t7810 makes.
>
> Any user who depends on that crazy expectation will be broken by
> such a change, even if we do not deprecate and remove the
> configuration variable.
Ah. Reading 84befcd (grep: add a grep.patternType configuration setting,
2012-08-03) explains the rules, although I agree they are crazy (mostly
because "basic" is different "fixed").
So I think there are two crazy things going on:
1. grep.extendedregexp takes precedence over the command-line (or at
least "--basic" on the command line).
2. The weird rules in 84befcd, where patternType=fixed has higher
precedence than extendedRegexp, but patternType=basic does not.
It seems like (1) is a bug, and one we should not have to worry about
compatibility while fixing. It stems from not telling the difference
between "the user asked for nothing, so we defaulted to basic" and "the
user explicitly asked for basic".
I think (2) _is_ kind of crazy, and stems from similar confusion. I
dunno. Part of me wants to say "I find it highly unlikely that anybody
ever actually relied on this, and therefore it is OK to bring it closer
to sanity without a deprecation period". But I admit that is just a gut
feeling.
But even that is a lesser breakage than taking away grep.extendedRegexp
entirely. Taking it away breaks anybody who uses it; tweaking (2) only
breaks people who set both config variables. But why would anyone do
that?
-Peff
next prev parent reply other threads:[~2016-07-22 20:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-18 22:56 git-prompt.sh incompatible with non-basic global grep.patternType Richard Soderberg
2016-07-19 11:24 ` Johannes Schindelin
2016-07-19 14:14 ` Richard Soderberg
2016-07-19 14:35 ` Johannes Schindelin
2016-07-20 13:42 ` Jeff King
2016-07-20 20:10 ` Junio C Hamano
2016-07-20 20:52 ` Jeff King
2016-07-22 19:21 ` Junio C Hamano
2016-07-22 19:28 ` Jeff King
2016-07-22 19:51 ` Junio C Hamano
2016-07-22 20:05 ` Jeff King [this message]
2016-07-22 20:33 ` Junio C Hamano
2016-07-22 23:28 ` Eric Sunshine
2016-07-25 16:16 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160722200545.GA18286@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=rsoderberg@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).