git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/1] Fix perl error "unescaped left brace in regex" for paranoid update hook

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Sep 11, 2019, 21:28 UTC
Message-ID
<nycvar.QRO.7.76.6.1909112326490.5377@tvgsbejvaqbjf.bet>
In-Reply-To
<2743caa22e60c5ddc04d388f21a04500d7bcac1f.1568097573.git.gitgitgadget@gmail.com>
Hi Dominic,

all looks good, with one exception: the Subject should start with `<area>:`, i.e. in this instance something like this would be better:

contrib/hooks: escape left brace in regex in the paranoid update hook

Ciao, Johannes

On Mon, 9 Sep 2019, Dominic Winkler via GitGitGadget wrote:
Show 37 quoted lines
> From: Dominic Winkler <d.winkler@flexarts.at>
>
> A literal "{" should now be escaped in a pattern starting from perl
> versions >= v5.26. In perl v5.22, using a literal { in a regular
> expression was deprecated, and will emit a warning if it isn't escaped: \{.
> In v5.26, this won't just warn, it'll cause a syntax error.
>
> (see https://metacpan.org/pod/release/RJBS/perl-5.22.0/pod/perldelta.pod)
>
> Signed-off-by: Dominic Winkler <d.winkler@flexarts.at>
> ---
>  contrib/hooks/update-paranoid | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/hooks/update-paranoid b/contrib/hooks/update-paranoid
> index d18b317b2f..fc0a242a4e 100755
> --- a/contrib/hooks/update-paranoid
> +++ b/contrib/hooks/update-paranoid
> @@ -302,13 +302,13 @@ $op = 'U' if ($op eq 'R'
>
>  RULE:
>  	foreach (@$rules) {
> -		while (/\${user\.([a-z][a-zA-Z0-9]+)}/) {
> +		while (/\$\{user\.([a-z][a-zA-Z0-9]+)}/) {
>  			my $k = lc $1;
>  			my $v = $data{"user.$k"};
>  			next RULE unless defined $v;
>  			next RULE if @$v != 1;
>  			next RULE unless defined $v->[0];
> -			s/\${user\.$k}/$v->[0]/g;
> +			s/\$\{user\.$k}/$v->[0]/g;
>  		}
>
>  		if (/^([AMD ]+)\s+of\s+([^\s]+)\s+for\s+([^\s]+)\s+diff\s+([^\s]+)$/) {
> --
> gitgitgadget
>
Previous: Dominic Winkler via GitGitGadgetNext: Dominic Winkler via GitGitGadget
Message 3 of 6 in “Fix perl error "unescaped left brace in regex" for paranoid update hook”
  1. 0/1 Fix perl error "unescaped left brace in regex" for paranoid update hookDominic Winkler via GitGitGadget, Sep 10, 2019
  2. 1/1 Fix perl error "unescaped left brace in regex" for paranoid update hookDominic Winkler via GitGitGadget, Sep 10, 2019
  3. Johannes SchindelinSep 11, 2019
  4. 0/1 Fix perl error "unescaped left brace in regex" for paranoid update hookDominic Winkler via GitGitGadget, Sep 11, 2019
  5. 1/1 contrib/hooks: escape left brace in regex in the paranoid update hookDominic Winkler via GitGitGadget, Sep 11, 2019
  6. Johannes SchindelinSep 12, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.