Message ID | pull.796.v3.git.1606342376.gitgitgadget@gmail.com (mailing list archive) |
---|---|
Headers | show |
Series | config: add --fixed-value option | expand |
"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes: > As reported [1], 'git maintenance unregister' fails when a repository is > located in a directory with regex glob characters. > > [1] > https://lore.kernel.org/git/2c2db228-069a-947d-8446-89f4d3f6181a@gmail.com/T/#mb96fa4187a0d6aeda097cd95804a8aafc0273022 > > The discussed solution was to modify 'git config' to specify that the > 'value_regex' argument should be treated as an exact string match. This is > the primary change in this series, with an additional patch at the end to > make 'git maintenance [un]register' use this option, when necessary. > > While we're here, let's rename 'value_regex' to 'value_pattern' to make > things a bit clearer. > > Updates in V3 > ============= > > * Renamed 'value_regex' to 'value_pattern' in code and 'value-pattern' in > docs (except po/) > > > * Reordered commits slightly to help with that rename. > > > * Updated tests to use 'test_when_finished rm -f ...' > > > * Changed all references to "glob" characters to "meta" characters. > > > * Several other test modifications. Thanks, Emily, for the review! > > > > Thanks, -Stolee > > P.S. Happy Thanksgiving to those celebrating! Thanks. The only thing that still stand out, after the first 7 patches (queued as its own "add --fixed-value option to config" topic) are queued, is that the early part of the documentation, namely, a paragraph where it mentions value-pattern, still lives in the world where it can only be a regexp. Perhaps insert the following between step 7 and 8? --- >8 ------ >8 ------ >8 ------ >8 ------ >8 ------ >8 --- Subject: config doc: value-pattern is not necessarily a regexp The introductory part of the "git config --help" mentions the optional value-pattern argument, but give no hint that it can be something other than a regular expression (worse, it just says "POSIX regexp", which usually means BRE but the regexp the command takes is ERE). Also, it needs to be documented that the '!' prefix to negate the match, which is only mentioned in this part of the document, works only with regexp and not with the --fixed-value. Signed-off-by: Junio C Hamano <gitster@pobox.com> --- Documentation/git-config.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git c/Documentation/git-config.txt w/Documentation/git-config.txt index 09a1d273a9..0e9351d3cb 100644 --- c/Documentation/git-config.txt +++ w/Documentation/git-config.txt @@ -33,10 +33,13 @@ escaped. Multiple lines can be added to an option by using the `--add` option. If you want to update or unset an option which can occur on multiple -lines, a POSIX regexp `value-pattern` needs to be given. Only the -existing values that match the regexp are updated or unset. If -you want to handle the lines that do *not* match the regex, just -prepend a single exclamation mark in front (see also <<EXAMPLES>>). +lines, a `value-pattern` (which is an extended regular expression, +unless the `--fixed-value` option is given) needs to be given. Only the +existing values that match the pattern are updated or unset. If +you want to handle the lines that do *not* match the pattern, just +prepend a single exclamation mark in front (see also <<EXAMPLES>>), +but note that this only works when the `--fixed-value` option is not +in use. The `--type=<type>` option instructs 'git config' to ensure that incoming and outgoing values are canonicalize-able under the given <type>. If no
On 11/25/2020 6:00 PM, Junio C Hamano wrote: > Thanks. The only thing that still stand out, after the first 7 > patches (queued as its own "add --fixed-value option to config" > topic) are queued, is that the early part of the documentation, > namely, a paragraph where it mentions value-pattern, still lives > in the world where it can only be a regexp. > > Perhaps insert the following between step 7 and 8? This patch LGTM. Thanks! -Stolee > --- >8 ------ >8 ------ >8 ------ >8 ------ >8 ------ >8 --- > Subject: config doc: value-pattern is not necessarily a regexp > > The introductory part of the "git config --help" mentions the > optional value-pattern argument, but give no hint that it can be > something other than a regular expression (worse, it just says > "POSIX regexp", which usually means BRE but the regexp the command > takes is ERE). Also, it needs to be documented that the '!' prefix > to negate the match, which is only mentioned in this part of the > document, works only with regexp and not with the --fixed-value. > > Signed-off-by: Junio C Hamano <gitster@pobox.com> > --- > Documentation/git-config.txt | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git c/Documentation/git-config.txt w/Documentation/git-config.txt > index 09a1d273a9..0e9351d3cb 100644 > --- c/Documentation/git-config.txt > +++ w/Documentation/git-config.txt > @@ -33,10 +33,13 @@ escaped. > > Multiple lines can be added to an option by using the `--add` option. > If you want to update or unset an option which can occur on multiple > -lines, a POSIX regexp `value-pattern` needs to be given. Only the > -existing values that match the regexp are updated or unset. If > -you want to handle the lines that do *not* match the regex, just > -prepend a single exclamation mark in front (see also <<EXAMPLES>>). > +lines, a `value-pattern` (which is an extended regular expression, > +unless the `--fixed-value` option is given) needs to be given. Only the > +existing values that match the pattern are updated or unset. If > +you want to handle the lines that do *not* match the pattern, just > +prepend a single exclamation mark in front (see also <<EXAMPLES>>), > +but note that this only works when the `--fixed-value` option is not > +in use. > > The `--type=<type>` option instructs 'git config' to ensure that incoming and > outgoing values are canonicalize-able under the given <type>. If no >
Derrick Stolee <stolee@gmail.com> writes: > On 11/25/2020 6:00 PM, Junio C Hamano wrote: > >> Thanks. The only thing that still stand out, after the first 7 >> patches (queued as its own "add --fixed-value option to config" >> topic) are queued, is that the early part of the documentation, >> namely, a paragraph where it mentions value-pattern, still lives >> in the world where it can only be a regexp. >> >> Perhaps insert the following between step 7 and 8? > > This patch LGTM. Thanks! Thanks.