Web lists-archives.com

Re: [PATCH 08/12] grep: make grep.patternType=[pcre|pcre1] a synonym for "perl"




On Sat, Apr 08, 2017 at 01:25:02PM +0000, Ævar Arnfjörð Bjarmason wrote:

> Make the pattern types "pcre" & "pcre1" synonyms for long-standing
> "perl" grep.patternType.
> 
> This change is part of a longer patch series to add pcre2 support to
> Git. It's nice to be able to performance test PCRE v1 v.s. v2 without
> having to recompile git, and doing that via grep.patternType makes
> sense.
> 
> However, just adding "pcre2" when we only have "perl" would be
> confusing, so start by adding a "pcre" & "pcre1" synonym.
> 
> In the future "perl" and "pcre" might be changed to default to "pcre2"
> instead of "pcre1", and depending on how Git is compiled the more
> specific "pcre1" or "pcre2" pattern types might produce an error.

I think this makes sense.

> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index 475e874d51..5ef12d0694 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -1624,6 +1624,15 @@ grep.patternType::
>  	'fixed', or 'perl' will enable the `--basic-regexp`, `--extended-regexp`,
>  	`--fixed-strings`, or `--perl-regexp` option accordingly, while the
>  	value 'default' will return to the default matching behavior.
> ++
> +The 'pcre' and 'pcre1' values are synonyms for 'perl'. The other
> +values starting with 'pcre' are reserved for future use, e.g. if we'd
> +like to use 'pcre2' for the PCRE v2 library.

Do you want to define this the other way around (that perl and pcre are
synonyms for pcre1)?

I know that hey are being added now as synonyms, but from the
perspective of the user (and this is the user-facing documentation), the
end-game we want is "you can pick pcre1 or pcre2, and the others are
floating synonyms that may change".

I think it would be OK to continue to refer to "perl" elsewhere. Even
though it's a synonym, it's the one we'd expect people to use.

-Peff