git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"J Smith" <dark.panda@gmail.com>, "Taylor Blau" <me@ttaylorr.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH v3 0/7] grep: simplify & delete "init" & "config" code
Date: Mon, 29 Nov 2021 15:50:46 +0100	[thread overview]
Message-ID: <cover-v3-0.7-00000000000-20211129T143956Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-v2-0.8-00000000000-20211110T013632Z-avarab@gmail.com>

In v1 and v2[1] of this series more code in grep.c was deleted by
changing what I think is a really obscure interaction between
"grep.extendedRegexp=true" and "grep.patternType".

Junio preferred having a deprecation period[2], so here's a re-roll
that preserves all existing behavior, at the cost of bit less code
deletion & simplification (from "97 insertions(+), 174 deletions(-)"
to "106 insertions(+), 131 deletions(-)").

Notes on individual patches below. This re-roll should address all
outstanding feedback on v2.

1. https://lore.kernel.org/git/cover-v2-0.8-00000000000-20211110T013632Z-avarab@gmail.com/
2. https://lore.kernel.org/git/xmqqk0hdqifg.fsf@gitster.g/

Ævar Arnfjörð Bjarmason (7):
  grep.h: remove unused "regex_t regexp" from grep_opt

No change.

  log tests: check if grep_config() is called by "log"-like cmds

Simplified the test, and it no longer depends (optionally) PCRE. We
just test BRE v.s. ERE instead.

  grep tests: add missing "grep.patternType" config test

A new test to assert existing behavior, we had a blindspot in this
area (could have hidden a possible regression).

  built-ins: trust the "prefix" from run_builtin()

Substantially the same, but I made some edits as requested to minimize
the diff size / skip any cleanups-while-at it.

  grep.c: don't pass along NULL callback value

Trivial commit message typo fix.

  grep API: call grep_config() after grep_init()

Removed stray leftover WIP code (an unused "caller_priv" struct
member), oops.

  grep: simplify config parsing and option parsing

Mostly new, replaces the now-ejected two last commits of v2 that
changed obscure behavior. We still delete most of the code involved in
this part of grep initialization and config handling, but now with no
changes in existing behavior.

This is now also ejected:

  grep docs: de-duplicate configuration sections
  (https://lore.kernel.org/git/patch-v2-4.8-efe95397d72-20211110T013632Z-avarab@gmail.com/)

Since I don't need to change any documentation anymore, moving around
the grep docs to live in one place isn't within the scope of this
series.

 builtin/grep.c    |  27 +++++-----
 builtin/log.c     |  13 ++++-
 builtin/ls-tree.c |   2 +-
 git.c             |   1 +
 grep.c            | 124 ++++++++--------------------------------------
 grep.h            |  33 ++++++++----
 revision.c        |   4 +-
 t/t4202-log.sh    |  24 +++++++++
 t/t7810-grep.sh   |   9 ++++
 9 files changed, 106 insertions(+), 131 deletions(-)

Range-diff against v2:
1:  1435db727ef = 1:  71ff51cb3c9 grep.h: remove unused "regex_t regexp" from grep_opt
3:  41e38ebb32c ! 2:  ec8e42ced1a log tests: check if grep_config() is called by "log"-like cmds
    @@ Commit message
         whether "git log" handles "grep.patternType", but also "git show"
         etc.
     
    -    It's sufficient to check whether a PCRE regex matches for the purposes
    -    of this test, we otherwise assume that it's running the same code as
    -    "git log", whose behavior is tested more exhaustively by test added in
    -    9df46763ef1e.
    +    It's sufficient to check whether we match a "fixed" or a "basic" regex
    +    here to see if these codepaths correctly invoked grep_config(). We
    +    don't need to check the details of their regular expression matching
    +    as the "log" test does.
     
         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
     
    @@ t/t4202-log.sh: test_expect_success !FAIL_PREREQS 'log with various grep.pattern
      
     +for cmd in show whatchanged reflog format-patch
     +do
    -+	myarg=
    -+	if test "$cmd" = "format-patch"
    -+	then
    -+		myarg="HEAD~.."
    -+	fi
    ++	case "$cmd" in
    ++	format-patch) myarg="HEAD~.." ;;
    ++	*) myarg= ;;
    ++	esac
     +
    -+	test_expect_success PCRE "$cmd: understands grep.patternType=perl, like 'log'" '
    -+		git -c grep.patternType=fixed -C pattern-type $cmd --grep="1(?=\|2)" $myarg >actual &&
    -+		test_must_be_empty actual &&
    -+		git -c grep.patternType=perl -C pattern-type $cmd --grep="1(?=\|2)" $myarg >actual &&
    -+		test_file_not_empty actual
    ++	test_expect_success "$cmd: understands grep.patternType, like 'log'" '
    ++		git init "pattern-type-$cmd" &&
    ++		(
    ++			cd "pattern-type-$cmd" &&
    ++			test_commit 1 file A &&
    ++			test_commit "(1|2)" file B 2 &&
    ++
    ++			git -c grep.patternType=fixed $cmd --grep="..." $myarg >actual &&
    ++			test_must_be_empty actual &&
    ++
    ++			git -c grep.patternType=basic $cmd --grep="..." $myarg >actual &&
    ++			test_file_not_empty actual
    ++		)
     +	'
     +done
    ++test_done
     +
      test_expect_success 'log --author' '
      	cat >expect <<-\EOF &&
8:  cc904d93b26 ! 3:  fcad1b1664b grep: make "extendedRegexp=true" the same as "patternType=extended"
    @@ Metadata
     Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
     
      ## Commit message ##
    -    grep: make "extendedRegexp=true" the same as "patternType=extended"
    +    grep tests: add missing "grep.patternType" config test
     
    -    In the preceding commit we changed how a "grep.patternType=default"
    -    set after "grep.extendedRegexp=true" would be handled so that the last
    -    set would win, but a "grep.extendedRegexp=true" would only be used if
    -    "grep.patternType" was set to a value other than "default".
    -
    -    Thus a user who had old config and set "grep.extendedRegexp=true" in
    -    their ~/.gitconfig expecting ERE behavior would be opted-in to say
    -    "perl" regexes if a system "/etc/gitconfig" started setting
    -    "grep.patternType=perl".
    -
    -    These funny semantics of only paying attention to a set if another key
    -    is not set to a given value aren't how we treat other config keys, so
    -    let's do away with this caveat for consistency.
    -
    -    The new semantics are simple, a "grep.extendedRegexp=true" is an exact
    -    synonym for specifying "grep.patternType=extended" in the
    -    config. We'll keep ignoring ""grep.extendedRegexp=false", although
    -    arguably we could treat it as a "grep.patternType=basic".
    -
    -    As argued in the preceding commit I think this behavior came about
    -    because we were conflating the state of our code's own internal
    -    "default" value with what we found in explicit user config. See
    -    84befcd0a4a (grep: add a grep.patternType configuration setting,
    -    2012-08-03) for that past behavior.
    -
    -    Let's further change the documentation to note that
    -    "grep.extendedRegexp" is a deprecated synonym, perhaps we'll be able
    -    to remove it at some point in the future and do away with this
    -    special-case entirely.
    +    Extend the grep tests to assert that setting
    +    "grep.patternType=extended" followed by "grep.patternType=default"
    +    will behave as if "--extended-regexp" was provided, and not as
    +    "--basic-regexp". In a subsequent commit we'll need to treat
    +    "grep.patternType=default" as a special-case, but let's make sure we
    +    don't ignore it if "grep.patternType" was set to a non-"default" value
    +    before.
     
         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
     
    - ## Documentation/config/grep.txt ##
    -@@ Documentation/config/grep.txt: grep.patternType::
    - 	value 'default' will return to the default matching behavior.
    - 
    - grep.extendedRegexp::
    --	If set to true, enable `--extended-regexp` option by default. This
    --	option is ignored when the `grep.patternType` option is set.
    -+	Deprecated synonym for 'grep.patternType=extended`.
    - 
    - grep.threads::
    - 	Number of grep worker threads to use. If unset (or set to 0), Git will
    -
    - ## grep.c ##
    -@@ grep.c: static const char *color_grep_slots[] = {
    - 
    - static int parse_pattern_type_arg(const char *opt, const char *arg)
    - {
    --	if (!strcmp(arg, "default"))
    --		return GREP_PATTERN_TYPE_UNSPECIFIED;
    --	else if (!strcmp(arg, "basic"))
    -+	if (!strcmp(arg, "basic") ||
    -+	    !strcmp(arg, "default"))
    - 		return GREP_PATTERN_TYPE_BRE;
    - 	else if (!strcmp(arg, "extended"))
    - 		return GREP_PATTERN_TYPE_ERE;
    -@@ grep.c: int grep_config(const char *var, const char *value, void *cb)
    - 	if (userdiff_config(var, value) < 0)
    - 		return -1;
    - 
    --	if (opt->pattern_type_option == GREP_PATTERN_TYPE_UNSPECIFIED &&
    --	    !strcmp(var, "grep.extendedregexp") &&
    -+	if (!strcmp(var, "grep.extendedregexp") &&
    - 	    git_config_bool(var, value)) {
    - 		opt->pattern_type_option = GREP_PATTERN_TYPE_ERE;
    - 		return 0;
    -
    - ## grep.h ##
    -@@ grep.h: enum grep_expr_node {
    - };
    - 
    - enum grep_pattern_type {
    --	GREP_PATTERN_TYPE_UNSPECIFIED = 0,
    --	GREP_PATTERN_TYPE_BRE,
    -+	GREP_PATTERN_TYPE_BRE = 0,
    - 	GREP_PATTERN_TYPE_ERE,
    - 	GREP_PATTERN_TYPE_FIXED,
    - 	GREP_PATTERN_TYPE_PCRE
    -@@ grep.h: struct grep_opt {
    - 	.relative = 1, \
    - 	.pathname = 1, \
    - 	.max_depth = -1, \
    --	.pattern_type_option = GREP_PATTERN_TYPE_UNSPECIFIED, \
    - 	.colors = { \
    - 		[GREP_COLOR_CONTEXT] = "", \
    - 		[GREP_COLOR_FILENAME] = "", \
    -
      ## t/t7810-grep.sh ##
     @@ t/t7810-grep.sh: do
    + 		test_cmp expected actual
      	'
      
    - 	test_expect_success "grep $L with grep.patternType=basic and grep.extendedRegexp=true" '
    --		echo "${HC}ab:a+bc" >expected &&
    -+		echo "${HC}ab:abc" >expected &&
    ++	test_expect_success "grep $L with grep.patternType=extended and grep.patternType=default" '
    ++		echo "${HC}ab:a+bc" >expected &&
    ++		git \
    ++			-c grep.patternType=extended \
    ++			-c grep.patternType=default \
    ++			grep "a+b*c" $H ab >actual &&
    ++		test_cmp expected actual
    ++	'
    ++
    + 	test_expect_success "grep $L with grep.patternType=extended and grep.extendedRegexp=false" '
    + 		echo "${HC}ab:abc" >expected &&
      		git \
    - 			-c grep.patternType=basic \
    - 			-c grep.extendedRegexp=true \
2:  63cf2fe266d ! 4:  854ffe8d0b9 built-ins: trust the "prefix" from run_builtin()
    @@ builtin/grep.c: int cmd_grep(int argc, const char **argv, const char *prefix)
     
      ## builtin/ls-tree.c ##
     @@ builtin/ls-tree.c: int cmd_ls_tree(int argc, const char **argv, const char *prefix)
    - 		OPT__ABBREV(&abbrev),
    - 		OPT_END()
    - 	};
    --
    --	git_config(git_default_config, NULL);
    + 
    + 	git_config(git_default_config, NULL);
      	ls_tree_prefix = prefix;
     -	if (prefix && *prefix)
     +	if (prefix)
      		chomp_prefix = strlen(prefix);
      
    -+	git_config(git_default_config, NULL);
      	argc = parse_options(argc, argv, prefix, ls_tree_options,
    - 			     ls_tree_usage, 0);
    - 	if (full_tree) {
    --		ls_tree_prefix = prefix = NULL;
    -+		ls_tree_prefix = NULL;
    - 		chomp_prefix = 0;
    - 	}
    - 	/* -d -r should imply -t, but -d by itself should not have to. */
    -@@ builtin/ls-tree.c: int cmd_ls_tree(int argc, const char **argv, const char *prefix)
    - 	parse_pathspec(&pathspec, PATHSPEC_ALL_MAGIC &
    - 				  ~(PATHSPEC_FROMTOP | PATHSPEC_LITERAL),
    - 		       PATHSPEC_PREFER_CWD,
    --		       prefix, argv + 1);
    -+		       ls_tree_prefix, argv + 1);
    - 	for (i = 0; i < pathspec.nr; i++)
    - 		pathspec.items[i].nowildcard_len = pathspec.items[i].len;
    - 	pathspec.has_wildcard = 0;
     
      ## git.c ##
    -@@ git.c: static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
    - {
    - 	int status, help;
    - 	struct stat st;
    --	const char *prefix;
    -+	const char *prefix = NULL;
    - 
    --	prefix = NULL;
    - 	help = argc == 2 && !strcmp(argv[1], "-h");
    - 	if (!help) {
    - 		if (p->option & RUN_SETUP)
     @@ git.c: static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
      			int nongit_ok;
      			prefix = setup_git_directory_gently(&nongit_ok);
4:  efe95397d72 < -:  ----------- grep docs: de-duplicate configuration sections
5:  d0f0ac6c7ae ! 5:  2536eae2c32 grep.c: don't pass along NULL callback value
    @@ Metadata
      ## Commit message ##
         grep.c: don't pass along NULL callback value
     
    -    Change grep_cmd_config() top stop passing around the always-NULL "cb"
    +    Change grep_cmd_config() to stop passing around the always-NULL "cb"
         value. When this code was added in 7e8f59d577e (grep: color patterns
         in output, 2009-03-07) it was non-NULL, but when that changed in
         15fabd1bbd4 (builtin/grep.c: make configuration callback more
6:  917944f79a5 ! 6:  4e1be7c165b grep API: call grep_config() after grep_init()
    @@ grep.c: int grep_config(const char *var, const char *value, void *cb)
     
      ## grep.h ##
     @@ grep.h: struct grep_opt {
    - 	int show_hunk_mark;
    - 	int file_break;
    - 	int heading;
    -+	void *caller_priv;
    - 	void *priv;
    - 
    - 	void (*output)(struct grep_opt *opt, const void *data, size_t size);
      	void *output_priv;
      };
      
7:  140a7416223 ! 7:  f40ab932cb1 grep: simplify config parsing, change grep.<rx config> interaction
    @@ Metadata
     Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
     
      ## Commit message ##
    -    grep: simplify config parsing, change grep.<rx config> interaction
    +    grep: simplify config parsing and option parsing
     
    -    Change the interaction between "grep.patternType=default" and
    -    "grep.extendedRegexp=true" to make setting "grep.extendedRegexp=true"
    -    synonymous with setting "grep.patternType=extended".
    -
    -    This changes our existing config parsing behavior as detailed below,
    -    but in a way that's consistent with how we parse other
    -    configuration.
    -
    -    We are breaking past promises here, but I doubt that this will impact
    -    anyone in practice. The reduction in complexity and resulting
    -    consistency with other default config behavior is worth it.
    +    Simplify the parsing of "grep.patternType" and
    +    "grep.extendedRegexp". This changes no behavior, but gets rid of
    +    complex parsing logic that isn't needed anymore.
     
         When "grep.patternType" was introduced in 84befcd0a4a (grep: add a
    -    grep.patternType configuration setting, 2012-08-03) we made two
    -    seemingly contradictory promises:
    +    grep.patternType configuration setting, 2012-08-03) we promised that:
     
          1. You can set "grep.patternType", and "[setting it to] 'default'
             will return to the default matching behavior".
     
    -     2. Support the existing "grep.extendedRegexp" option, but ignore it
    -        when the new "grep.patternType" is set, *except* "when the
    -        `grep.patternType` option is set. to a value other than 'default'".
    -
    -    I think that 84befcd0a4a probably didn't intend this behavior, but
    -    instead ended up conflating our internal "unspecified" state with a
    -    user's explicit desire to set the configuration back to the
    -    default.
    -
    -    I.e. a user would correctly expect this to keep working:
    -
    -        # ERE grep
    -        git -c grep.extendedRegexp=true grep <pattern>
    -
    -    And likewise for "grep.patternType=default" to take precedence over
    -    the disfavored "grep.extendedRegexp" option, i.e. the usual "last set
    -    wins" semantics.
    +     2. We'd support the existing "grep.extendedRegexp" option, but ignore
    +        it when the new "grep.patternType" option is set. We said we'd
    +        only ignore the older "grep.extendedRegexp" option "when the
    +        `grep.patternType` option is set. to a value other than
    +        'default'".
     
    -        # BRE grep
    -        git -c grep.extendedRegexp=true -c grep.patternType=basic grep <pattern>
    +    In a preceding commit we changed grep_config() to be called after
    +    grep_init(), which means that much of the complexity here can go
    +    away.
     
    -    But probably not for this to ignore the favored "grep.patternType"
    -    option entirely, say if /etc/gitconfig was still setting
    -    "grep.extendedRegexp", but "~/.gitconfig" used the new
    -    "grep.patternType" (and wanted to use the "default" value):
    -
    -        # Was ERE, now BRE
    -        git -c grep.extendedRegexp=true grep.patternType=default grep <pattern>
    -
    -    I think that in practice nobody or almost nobody is going to be
    -    relying on this obscure interaction, and as shown here it makes the
    -    config parsing much simpler. We no longer have to carry a complex
    -    state machine in "grep_commit_pattern_type()" and
    -    "grep_set_pattern_type_option()".
    -
    -    We can also do away with the "int fixed" and "int pcre2" members in
    -    favor of using "pattern_type_option" directly in "grep.c", as well as
    -    dropping the "pattern_type_arg" variable in "builtin/grep.c" in favor
    -    of using the "pattern_type_option" member directly.
    +    Now as before when we only understand a "grep.extendedRegexp" setting
    +    of "true", and if "grep.patterntype=default" is set we'll interpret it
    +    as "grep.patterntype=basic", except if we previously saw a
    +    "grep.extendedRegexp", then it's interpreted as
    +    "grep.patterntype=extended".
     
         See my 07a3d411739 (grep: remove regflags from the public grep_opt
         API, 2017-06-29) for addition of the two comments being removed here,
         i.e. the complexity noted in that commit is now going away.
     
    -    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    +    We don't need grep_commit_pattern_type() anymore, we can instead have
    +    OPT_SET_INT() in "builtin/grep.c" manipulate the "pattern_type_option"
    +    member in "struct grep_opt" directly.
     
    - ## Documentation/config/grep.txt ##
    -@@ Documentation/config/grep.txt: grep.patternType::
    - 
    - grep.extendedRegexp::
    - 	If set to true, enable `--extended-regexp` option by default. This
    --	option is ignored when the `grep.patternType` option is set to a value
    --	other than 'default'.
    -+	option is ignored when the `grep.patternType` option is set.
    - 
    - grep.threads::
    - 	Number of grep worker threads to use. If unset (or set to 0), Git will
    +    We can also do away with the indirection of the "int fixed" and "int
    +    pcre2" members in favor of using "pattern_type_option" directly in
    +    "grep.c".
    +
    +    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
     
      ## builtin/grep.c ##
     @@ builtin/grep.c: int cmd_grep(int argc, const char **argv, const char *prefix)
    @@ builtin/grep.c: int cmd_grep(int argc, const char **argv, const char *prefix)
      		int fallback = 0;
     
      ## grep.c ##
    +@@ grep.c: static const char *color_grep_slots[] = {
    + 
    + static int parse_pattern_type_arg(const char *opt, const char *arg)
    + {
    +-	if (!strcmp(arg, "default"))
    +-		return GREP_PATTERN_TYPE_UNSPECIFIED;
    +-	else if (!strcmp(arg, "basic"))
    ++	if (!strcmp(arg, "basic"))
    + 		return GREP_PATTERN_TYPE_BRE;
    + 	else if (!strcmp(arg, "extended"))
    + 		return GREP_PATTERN_TYPE_ERE;
     @@ grep.c: int grep_config(const char *var, const char *value, void *cb)
    - 	if (userdiff_config(var, value) < 0)
      		return -1;
      
    --	if (!strcmp(var, "grep.extendedregexp")) {
    --		opt->extended_regexp_option = git_config_bool(var, value);
    -+	if (opt->pattern_type_option == GREP_PATTERN_TYPE_UNSPECIFIED &&
    -+	    !strcmp(var, "grep.extendedregexp") &&
    -+	    git_config_bool(var, value)) {
    -+		opt->pattern_type_option = GREP_PATTERN_TYPE_ERE;
    + 	if (!strcmp(var, "grep.extendedregexp")) {
    ++		if (opt->extended_regexp_option)
    ++			return 0;
    + 		opt->extended_regexp_option = git_config_bool(var, value);
    ++		if (opt->extended_regexp_option)
    ++			opt->pattern_type_option = GREP_PATTERN_TYPE_ERE;
    ++		return 0;
    ++	}
    ++
    ++	if (!strcmp(var, "grep.patterntype") &&
    ++	    !strcmp(value, "default")) {
    ++		opt->pattern_type_option = opt->extended_regexp_option == 1
    ++			? GREP_PATTERN_TYPE_ERE : GREP_PATTERN_TYPE_BRE;
      		return 0;
      	}
      
    + 	if (!strcmp(var, "grep.patterntype")) {
    ++		opt->extended_regexp_option = -1; /* ignore */
    + 		opt->pattern_type_option = parse_pattern_type_arg(var, value);
    + 		return 0;
    + 	}
     @@ grep.c: void grep_init(struct grep_opt *opt, struct repository *repo)
      	opt->header_tail = &opt->header_list;
      }
    @@ grep.c: static void compile_regexp(struct grep_pat *p, struct grep_opt *opt)
      	if (err) {
     
      ## grep.h ##
    +@@ grep.h: enum grep_expr_node {
    + };
    + 
    + enum grep_pattern_type {
    +-	GREP_PATTERN_TYPE_UNSPECIFIED = 0,
    +-	GREP_PATTERN_TYPE_BRE,
    ++	GREP_PATTERN_TYPE_BRE = 0,
    + 	GREP_PATTERN_TYPE_ERE,
    + 	GREP_PATTERN_TYPE_FIXED,
    + 	GREP_PATTERN_TYPE_PCRE
     @@ grep.h: struct grep_opt {
      	int unmatch_name_only;
      	int count;
    @@ grep.h: struct grep_opt {
      	int pathname;
      	int null_following_name;
     @@ grep.h: struct grep_opt {
    - 	int max_depth;
      	int funcname;
      	int funcbody;
    --	int extended_regexp_option;
    + 	int extended_regexp_option;
     -	int pattern_type_option;
     +	enum grep_pattern_type pattern_type_option;
      	int ignore_locale;
      	char colors[NR_GREP_COLORS][COLOR_MAXLEN];
      	unsigned pre_context;
     @@ grep.h: struct grep_opt {
    + 	.relative = 1, \
    + 	.pathname = 1, \
    + 	.max_depth = -1, \
    +-	.pattern_type_option = GREP_PATTERN_TYPE_UNSPECIFIED, \
    + 	.colors = { \
    + 		[GREP_COLOR_CONTEXT] = "", \
    + 		[GREP_COLOR_FILENAME] = "", \
    +@@ grep.h: struct grep_opt {
      
      int grep_config(const char *var, const char *value, void *);
      void grep_init(struct grep_opt *, struct repository *repo);
    @@ revision.c: int setup_revisions(int argc, const char **argv, struct rev_info *re
      	if (!is_encoding_utf8(get_log_output_encoding()))
      		revs->grep_filter.ignore_locale = 1;
      	compile_grep_patterns(&revs->grep_filter);
    -
    - ## t/t7810-grep.sh ##
    -@@ t/t7810-grep.sh: do
    - 	'
    - 
    - 	test_expect_success "grep $L with grep.extendedRegexp=true and grep.patternType=default" '
    --		echo "${HC}ab:abc" >expected &&
    -+		echo "${HC}ab:a+bc" >expected &&
    - 		git \
    - 			-c grep.extendedRegexp=true \
    - 			-c grep.patternType=default \
-- 
2.34.1.841.gf15fb7e6f34


  parent reply	other threads:[~2021-11-29 18:27 UTC|newest]

Thread overview: 151+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-06 21:10 [PATCH 0/8] grep: simplify & delete code by changing obscure cfg variable behavior Ævar Arnfjörð Bjarmason
2021-11-06 21:10 ` [PATCH 1/8] grep.h: remove unused "regex_t regexp" from grep_opt Ævar Arnfjörð Bjarmason
2021-11-06 21:10 ` [PATCH 2/8] git.c & grep.c: assert that "prefix" is NULL or non-zero string Ævar Arnfjörð Bjarmason
2021-11-08 20:37   ` Taylor Blau
2021-11-06 21:10 ` [PATCH 3/8] grep: remove unused "prefix_length" member Ævar Arnfjörð Bjarmason
2021-11-08 20:42   ` Taylor Blau
2021-11-06 21:10 ` [PATCH 4/8] grep.c: move "prefix" out of "struct grep_opt" Ævar Arnfjörð Bjarmason
2021-11-08 20:56   ` Taylor Blau
2021-11-09  2:10     ` Ævar Arnfjörð Bjarmason
2021-11-10  0:18       ` Taylor Blau
2021-11-06 21:10 ` [PATCH 5/8] log tests: check if grep_config() is called by "log"-like cmds Ævar Arnfjörð Bjarmason
2021-11-06 21:10 ` [PATCH 6/8] grep API: call grep_config() after grep_init() Ævar Arnfjörð Bjarmason
2021-11-08 21:49   ` Taylor Blau
2021-11-09  2:06     ` Ævar Arnfjörð Bjarmason
2021-11-10  0:18       ` Taylor Blau
2021-11-06 21:10 ` [PATCH 7/8] grep: simplify config parsing, change grep.<rx config> interaction Ævar Arnfjörð Bjarmason
2021-11-08 23:04   ` Taylor Blau
2021-11-09  2:01     ` Ævar Arnfjörð Bjarmason
2021-11-10  0:16       ` Taylor Blau
2021-11-06 21:10 ` [PATCH 8/8] grep: make "extendedRegexp=true" the same as "patternType=extended" Ævar Arnfjörð Bjarmason
2021-11-10  1:43 ` [PATCH v2 0/8] grep: simplify & delete code by changing obscure cfg variable behavior Ævar Arnfjörð Bjarmason
2021-11-10  1:43   ` [PATCH v2 1/8] grep.h: remove unused "regex_t regexp" from grep_opt Ævar Arnfjörð Bjarmason
2021-11-12 16:11     ` Junio C Hamano
2021-11-10  1:43   ` [PATCH v2 2/8] built-ins: trust the "prefix" from run_builtin() Ævar Arnfjörð Bjarmason
2021-11-12 16:38     ` Junio C Hamano
2021-11-10  1:43   ` [PATCH v2 3/8] log tests: check if grep_config() is called by "log"-like cmds Ævar Arnfjörð Bjarmason
2021-11-12 17:09     ` Junio C Hamano
2021-11-10  1:43   ` [PATCH v2 4/8] grep docs: de-duplicate configuration sections Ævar Arnfjörð Bjarmason
2021-11-12 17:15     ` Junio C Hamano
2021-11-10  1:43   ` [PATCH v2 5/8] grep.c: don't pass along NULL callback value Ævar Arnfjörð Bjarmason
2021-11-12 17:18     ` Junio C Hamano
2021-11-10  1:43   ` [PATCH v2 6/8] grep API: call grep_config() after grep_init() Ævar Arnfjörð Bjarmason
2021-11-12 17:32     ` Junio C Hamano
2021-11-10  1:43   ` [PATCH v2 7/8] grep: simplify config parsing, change grep.<rx config> interaction Ævar Arnfjörð Bjarmason
2021-11-12 19:19     ` Junio C Hamano
2021-11-13  9:55       ` Ævar Arnfjörð Bjarmason
2021-11-10  1:43   ` [PATCH v2 8/8] grep: make "extendedRegexp=true" the same as "patternType=extended" Ævar Arnfjörð Bjarmason
2021-11-12 19:32     ` Junio C Hamano
2021-11-10  2:23   ` [PATCH v2 0/8] grep: simplify & delete code by changing obscure cfg variable behavior Taylor Blau
2021-11-29 14:50   ` Ævar Arnfjörð Bjarmason [this message]
2021-11-29 14:50     ` [PATCH v3 1/7] grep.h: remove unused "regex_t regexp" from grep_opt Ævar Arnfjörð Bjarmason
2021-11-29 14:50     ` [PATCH v3 2/7] log tests: check if grep_config() is called by "log"-like cmds Ævar Arnfjörð Bjarmason
2022-03-04  8:57       ` Tests in t4202 are aborted early, was: Re: [PATCH v3 2/7] log Fabian Stelzer
2022-03-04 10:05         ` [PATCH] log tests: fix "abort tests early" regression in ff37a60c369 Ævar Arnfjörð Bjarmason
2021-11-29 14:50     ` [PATCH v3 3/7] grep tests: add missing "grep.patternType" config test Ævar Arnfjörð Bjarmason
2021-11-29 21:52       ` Junio C Hamano
2021-12-03  0:48         ` Junio C Hamano
2021-11-29 14:50     ` [PATCH v3 4/7] built-ins: trust the "prefix" from run_builtin() Ævar Arnfjörð Bjarmason
2021-11-29 14:50     ` [PATCH v3 5/7] grep.c: don't pass along NULL callback value Ævar Arnfjörð Bjarmason
2021-11-29 14:50     ` [PATCH v3 6/7] grep API: call grep_config() after grep_init() Ævar Arnfjörð Bjarmason
2021-11-29 14:50     ` [PATCH v3 7/7] grep: simplify config parsing and option parsing Ævar Arnfjörð Bjarmason
2021-11-29 21:06     ` [PATCH v3 0/7] grep: simplify & delete "init" & "config" code Junio C Hamano
2021-11-29 21:36     ` Junio C Hamano
2021-12-03 10:19   ` [PATCH v4 " Ævar Arnfjörð Bjarmason
2021-12-03 10:19     ` [PATCH v4 1/7] grep.h: remove unused "regex_t regexp" from grep_opt Ævar Arnfjörð Bjarmason
2021-12-03 10:19     ` [PATCH v4 2/7] log tests: check if grep_config() is called by "log"-like cmds Ævar Arnfjörð Bjarmason
2021-12-03 10:19     ` [PATCH v4 3/7] grep tests: add missing "grep.patternType" config test Ævar Arnfjörð Bjarmason
2021-12-03 10:19     ` [PATCH v4 4/7] built-ins: trust the "prefix" from run_builtin() Ævar Arnfjörð Bjarmason
2021-12-03 10:19     ` [PATCH v4 5/7] grep.c: don't pass along NULL callback value Ævar Arnfjörð Bjarmason
2021-12-03 10:19     ` [PATCH v4 6/7] grep API: call grep_config() after grep_init() Ævar Arnfjörð Bjarmason
2021-12-03 10:19     ` [PATCH v4 7/7] grep: simplify config parsing and option parsing Ævar Arnfjörð Bjarmason
2021-12-22  2:58     ` [PATCH v5 0/7] grep: simplify & delete "init" & "config" code Ævar Arnfjörð Bjarmason
2021-12-22  2:58       ` [PATCH v5 1/7] grep.h: remove unused "regex_t regexp" from grep_opt Ævar Arnfjörð Bjarmason
2021-12-22  2:58       ` [PATCH v5 2/7] log tests: check if grep_config() is called by "log"-like cmds Ævar Arnfjörð Bjarmason
2021-12-22  2:58       ` [PATCH v5 3/7] grep tests: add missing "grep.patternType" config test Ævar Arnfjörð Bjarmason
2021-12-23 22:25         ` Junio C Hamano
2021-12-25  0:06           ` Re* " Junio C Hamano
2021-12-25  0:19             ` [RFC/PATCH] grep: allow scripts to ignore configured pattern type Junio C Hamano
2021-12-26 23:09               ` Ævar Arnfjörð Bjarmason
2021-12-25  1:04             ` Re* [PATCH v5 3/7] grep tests: add missing "grep.patternType" config test Junio C Hamano
2021-12-22  2:58       ` [PATCH v5 4/7] built-ins: trust the "prefix" from run_builtin() Ævar Arnfjörð Bjarmason
2021-12-22  2:58       ` [PATCH v5 5/7] grep.c: don't pass along NULL callback value Ævar Arnfjörð Bjarmason
2021-12-22  2:58       ` [PATCH v5 6/7] grep API: call grep_config() after grep_init() Ævar Arnfjörð Bjarmason
2021-12-22  2:58       ` [PATCH v5 7/7] grep: simplify config parsing and option parsing Ævar Arnfjörð Bjarmason
2021-12-23 22:37         ` Junio C Hamano
2021-12-23  0:30       ` [PATCH v5 0/7] grep: simplify & delete "init" & "config" code Junio C Hamano
2021-12-26 22:37       ` [PATCH v6 " Ævar Arnfjörð Bjarmason
2021-12-26 22:37         ` [PATCH v6 1/7] grep.h: remove unused "regex_t regexp" from grep_opt Ævar Arnfjörð Bjarmason
2021-12-26 22:37         ` [PATCH v6 2/7] log tests: check if grep_config() is called by "log"-like cmds Ævar Arnfjörð Bjarmason
2021-12-26 22:37         ` [PATCH v6 3/7] grep tests: add missing "grep.patternType" config tests Ævar Arnfjörð Bjarmason
2021-12-26 22:37         ` [PATCH v6 4/7] built-ins: trust the "prefix" from run_builtin() Ævar Arnfjörð Bjarmason
2021-12-26 22:37         ` [PATCH v6 5/7] grep.c: don't pass along NULL callback value Ævar Arnfjörð Bjarmason
2021-12-26 22:37         ` [PATCH v6 6/7] grep API: call grep_config() after grep_init() Ævar Arnfjörð Bjarmason
2021-12-26 22:37         ` [PATCH v6 7/7] grep: simplify config parsing and option parsing Ævar Arnfjörð Bjarmason
2021-12-27  6:06           ` Junio C Hamano
2021-12-27 18:51             ` Junio C Hamano
2021-12-28  1:07         ` [PATCH v7 00/10] grep: simplify & delete "init" & "config" code Ævar Arnfjörð Bjarmason
2021-12-28  1:07           ` [PATCH v7 01/10] grep.h: remove unused "regex_t regexp" from grep_opt Ævar Arnfjörð Bjarmason
2021-12-28  1:07           ` [PATCH v7 02/10] log tests: check if grep_config() is called by "log"-like cmds Ævar Arnfjörð Bjarmason
2021-12-28  1:07           ` [PATCH v7 03/10] grep tests: add missing "grep.patternType" config tests Ævar Arnfjörð Bjarmason
2021-12-28  1:07           ` [PATCH v7 04/10] built-ins: trust the "prefix" from run_builtin() Ævar Arnfjörð Bjarmason
2021-12-28  1:07           ` [PATCH v7 05/10] grep.c: don't pass along NULL callback value Ævar Arnfjörð Bjarmason
2021-12-28  1:07           ` [PATCH v7 06/10] grep API: call grep_config() after grep_init() Ævar Arnfjörð Bjarmason
2021-12-28  1:07           ` [PATCH v7 07/10] grep.h: make "grep_opt.pattern_type_option" use its enum Ævar Arnfjörð Bjarmason
2021-12-28  1:07           ` [PATCH v7 08/10] grep.c: do "if (bool && memchr())" not "if (memchr() && bool)" Ævar Arnfjörð Bjarmason
2021-12-28  1:07           ` [PATCH v7 09/10] grep: simplify config parsing and option parsing Ævar Arnfjörð Bjarmason
2021-12-28  1:07           ` [PATCH v7 10/10] grep.[ch]: remove GREP_PATTERN_TYPE_UNSPECIFIED Ævar Arnfjörð Bjarmason
2022-01-18 15:55           ` [PATCH v8 00/10] grep: simplify & delete "init" & "config" code Ævar Arnfjörð Bjarmason
2022-01-18 15:55             ` [PATCH v8 01/10] grep.h: remove unused "regex_t regexp" from grep_opt Ævar Arnfjörð Bjarmason
2022-01-18 15:55             ` [PATCH v8 02/10] log tests: check if grep_config() is called by "log"-like cmds Ævar Arnfjörð Bjarmason
2022-01-18 15:55             ` [PATCH v8 03/10] grep tests: add missing "grep.patternType" config tests Ævar Arnfjörð Bjarmason
2022-01-18 15:55             ` [PATCH v8 04/10] built-ins: trust the "prefix" from run_builtin() Ævar Arnfjörð Bjarmason
2022-01-18 15:55             ` [PATCH v8 05/10] grep.c: don't pass along NULL callback value Ævar Arnfjörð Bjarmason
2022-01-18 15:55             ` [PATCH v8 06/10] grep API: call grep_config() after grep_init() Ævar Arnfjörð Bjarmason
2022-01-18 15:55             ` [PATCH v8 07/10] grep.h: make "grep_opt.pattern_type_option" use its enum Ævar Arnfjörð Bjarmason
2022-01-18 15:55             ` [PATCH v8 08/10] grep.c: do "if (bool && memchr())" not "if (memchr() && bool)" Ævar Arnfjörð Bjarmason
2022-01-18 15:55             ` [PATCH v8 09/10] grep: simplify config parsing and option parsing Ævar Arnfjörð Bjarmason
2022-01-18 22:50               ` Junio C Hamano
2022-01-18 22:55                 ` Junio C Hamano
2022-01-19  0:17                 ` Ævar Arnfjörð Bjarmason
2022-01-19  1:09                   ` Junio C Hamano
2022-01-19  1:15                     ` Ævar Arnfjörð Bjarmason
2022-01-18 15:55             ` [PATCH v8 10/10] grep.[ch]: remove GREP_PATTERN_TYPE_UNSPECIFIED Ævar Arnfjörð Bjarmason
2022-01-27 11:56             ` [PATCH v9 0/9] grep: simplify & delete "init" & "config" code Ævar Arnfjörð Bjarmason
2022-01-27 11:56               ` [PATCH v9 1/9] grep.h: remove unused "regex_t regexp" from grep_opt Ævar Arnfjörð Bjarmason
2022-01-27 11:56               ` [PATCH v9 2/9] log tests: check if grep_config() is called by "log"-like cmds Ævar Arnfjörð Bjarmason
2022-01-27 11:56               ` [PATCH v9 3/9] grep tests: add missing "grep.patternType" config tests Ævar Arnfjörð Bjarmason
2022-01-27 11:56               ` [PATCH v9 4/9] built-ins: trust the "prefix" from run_builtin() Ævar Arnfjörð Bjarmason
2022-01-27 11:56               ` [PATCH v9 5/9] grep.c: don't pass along NULL callback value Ævar Arnfjörð Bjarmason
2022-01-27 11:56               ` [PATCH v9 6/9] grep API: call grep_config() after grep_init() Ævar Arnfjörð Bjarmason
2022-01-27 11:56               ` [PATCH v9 7/9] grep.h: make "grep_opt.pattern_type_option" use its enum Ævar Arnfjörð Bjarmason
2022-01-27 11:56               ` [PATCH v9 8/9] grep.c: do "if (bool && memchr())" not "if (memchr() && bool)" Ævar Arnfjörð Bjarmason
2022-01-27 11:56               ` [PATCH v9 9/9] grep: simplify config parsing and option parsing Ævar Arnfjörð Bjarmason
2022-01-27 20:30                 ` Junio C Hamano
2022-01-27 21:35                   ` Junio C Hamano
2022-01-27 21:39                     ` Junio C Hamano
2022-02-04 21:20               ` [PATCH v10 0/9] grep: simplify & delete "init" & "config" code Ævar Arnfjörð Bjarmason
2022-02-04 21:20                 ` [PATCH v10 1/9] grep.h: remove unused "regex_t regexp" from grep_opt Ævar Arnfjörð Bjarmason
2022-02-04 21:20                 ` [PATCH v10 2/9] log tests: check if grep_config() is called by "log"-like cmds Ævar Arnfjörð Bjarmason
2022-02-04 21:20                 ` [PATCH v10 3/9] grep tests: add missing "grep.patternType" config tests Ævar Arnfjörð Bjarmason
2022-02-04 23:03                   ` Junio C Hamano
2022-02-04 23:24                   ` Junio C Hamano
2022-02-04 21:20                 ` [PATCH v10 4/9] built-ins: trust the "prefix" from run_builtin() Ævar Arnfjörð Bjarmason
2022-02-04 21:20                 ` [PATCH v10 5/9] grep.c: don't pass along NULL callback value Ævar Arnfjörð Bjarmason
2022-02-04 21:20                 ` [PATCH v10 6/9] grep API: call grep_config() after grep_init() Ævar Arnfjörð Bjarmason
2022-02-04 21:20                 ` [PATCH v10 7/9] grep.h: make "grep_opt.pattern_type_option" use its enum Ævar Arnfjörð Bjarmason
2022-02-04 21:20                 ` [PATCH v10 8/9] grep.c: do "if (bool && memchr())" not "if (memchr() && bool)" Ævar Arnfjörð Bjarmason
2022-02-04 21:20                 ` [PATCH v10 9/9] grep: simplify config parsing and option parsing Ævar Arnfjörð Bjarmason
2022-02-04 23:41                   ` Junio C Hamano
2022-02-16  0:00                 ` [PATCH v11 00/10] grep: simplify & delete "init" & "config" code Ævar Arnfjörð Bjarmason
2022-02-16  0:00                   ` [PATCH v11 01/10] grep.h: remove unused "regex_t regexp" from grep_opt Ævar Arnfjörð Bjarmason
2022-02-16  0:00                   ` [PATCH v11 02/10] log tests: check if grep_config() is called by "log"-like cmds Ævar Arnfjörð Bjarmason
2022-02-16  0:00                   ` [PATCH v11 03/10] grep tests: create a helper function for "BRE" or "ERE" Ævar Arnfjörð Bjarmason
2022-02-16  0:00                   ` [PATCH v11 04/10] grep tests: add missing "grep.patternType" config tests Ævar Arnfjörð Bjarmason
2022-02-16  0:00                   ` [PATCH v11 05/10] built-ins: trust the "prefix" from run_builtin() Ævar Arnfjörð Bjarmason
2022-02-16  0:00                   ` [PATCH v11 06/10] grep.c: don't pass along NULL callback value Ævar Arnfjörð Bjarmason
2022-02-16  0:00                   ` [PATCH v11 07/10] grep API: call grep_config() after grep_init() Ævar Arnfjörð Bjarmason
2022-02-16  0:00                   ` [PATCH v11 08/10] grep.h: make "grep_opt.pattern_type_option" use its enum Ævar Arnfjörð Bjarmason
2022-02-16  0:00                   ` [PATCH v11 09/10] grep.c: do "if (bool && memchr())" not "if (memchr() && bool)" Ævar Arnfjörð Bjarmason
2022-02-16  0:00                   ` [PATCH v11 10/10] grep: simplify config parsing and option parsing Ævar Arnfjörð Bjarmason
2022-02-16  2:20                   ` [PATCH v11 00/10] grep: simplify & delete "init" & "config" code 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=cover-v3-0.7-00000000000-20211129T143956Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=dark.panda@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.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).