user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Subject: [PATCH 3/2] init: support git <2.30 for "-c KEY=VALUE" args
Date: Sun, 25 Jul 2021 10:40:17 +0000	[thread overview]
Message-ID: <20210725104017.GA2410@dcvr> (raw)
In-Reply-To: <20210721140550.9901-2-e@80x24.org>

It turns out `--fixed-value' is a relatively new git-config(1)
feature in git 2.30+ (December 2020).  So use the quotemeta
perlop for now since it seems compatible-enough for POSIX ERE
used by git.
---
 script/public-inbox-init | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/script/public-inbox-init b/script/public-inbox-init
index e22a0564..6fac4d18 100755
--- a/script/public-inbox-init
+++ b/script/public-inbox-init
@@ -231,8 +231,11 @@ run_die([@x, "$pfx.newsgroup", $ng]) if $ng ne '';
 
 for my $kv (@c_extra) {
 	my ($k, $v) = split(/=/, $kv, 2);
-	# --fixed-value for idempotent invocations
-	run_die([@x, qw(--replace-all --fixed-value), "$pfx.$k", $v, $v]);
+	# git 2.30+ has --fixed-value for idempotent invocations,
+	# but that's too new to depend on in 2021.  Perl quotemeta
+	# seems compatible enough for POSIX ERE which git uses
+	my $re = '^'.quotemeta($v).'$';
+	run_die([@x, qw(--replace-all), "$pfx.$k", $v, $re]);
 }
 
 # needed for git prior to v2.1.0

  reply	other threads:[~2021-07-25 10:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 20:03 Restarting daemons on config file change Konstantin Ryabitsev
2021-07-19 20:49 ` Eric Wong
2021-07-20  8:58   ` [PATCH] httpd: fix SIGHUP by invalidating cache on reload Eric Wong
2021-07-20 17:00   ` Restarting daemons on config file change Konstantin Ryabitsev
2021-07-20 20:34     ` Eric Wong
2021-07-20 20:49       ` Konstantin Ryabitsev
2021-07-20 21:07         ` Eric Wong
2021-07-20 21:18           ` Konstantin Ryabitsev
2021-07-21 14:05             ` [PATCH 1/2] extsearch: support publicinbox.*.boost parameter Eric Wong
2021-07-21 14:05             ` [PATCH 2/2] init: allow arbitrary key-values via -c KEY=VALUE Eric Wong
2021-07-25 10:40               ` Eric Wong [this message]
2021-07-21 15:32             ` [PATCH 0/2] things to make mirroring easier Konstantin Ryabitsev

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

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210725104017.GA2410@dcvr \
    --to=e@80x24.org \
    --cc=konstantin@linuxfoundation.org \
    --cc=meta@public-inbox.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).