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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> 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.

 grep.c | 4 ++--
 grep.h | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/grep.c b/grep.c
index 394c856..7b1d423 100644
--- a/grep.c
+++ b/grep.c
@@ -73,9 +73,9 @@ int grep_config(const char *var, const char *value, void *cb)
 
 	if (!strcmp(var, "grep.extendedregexp")) {
 		if (git_config_bool(var, value))
-			opt->extended_regexp_option = 1;
+			opt->pattern_type_option = GREP_PATTERN_ERE;
 		else
-			opt->extended_regexp_option = 0;
+			opt->pattern_type_option = GREP_PATTERN_BRE;
 		return 0;
 	}
 
diff --git a/grep.h b/grep.h
index cee4357..fc36c2a 100644
--- a/grep.h
+++ b/grep.h
@@ -119,7 +119,6 @@ struct grep_opt {
 	int max_depth;
 	int funcname;
 	int funcbody;
-	int extended_regexp_option;
 	int pattern_type_option;
 	char color_context[COLOR_MAXLEN];
 	char color_filename[COLOR_MAXLEN];
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]