unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 6/6] config: eliminate unnecessary join call up front
Date: Sun, 20 Dec 2020 06:30:16 +0000	[thread overview]
Message-ID: <20201220063016.20959-7-e@80x24.org> (raw)
In-Reply-To: <20201220063016.20959-1-e@80x24.org>

We can rely on implicit join in string interpolation on die()
iff needed.

And just creating the arrayref up front to avoid an extra
backslash seems nicer at the moment.
---
 lib/PublicInbox/Config.pm | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm
index 199ce019..2f5c83cd 100644
--- a/lib/PublicInbox/Config.pm
+++ b/lib/PublicInbox/Config.pm
@@ -163,11 +163,10 @@ sub config_fh_parse ($$$) {
 sub git_config_dump {
 	my ($file) = @_;
 	return {} unless -e $file;
-	my @cmd = (qw/git config -z -l --includes/, "--file=$file");
-	my $cmd = join(' ', @cmd);
-	my $fh = popen_rd(\@cmd);
+	my $cmd = [ qw(git config -z -l --includes), "--file=$file" ];
+	my $fh = popen_rd($cmd);
 	my $rv = config_fh_parse($fh, "\0", "\n");
-	close $fh or die "failed to close ($cmd) pipe: $?";
+	close $fh or die "failed to close (@$cmd) pipe: $?";
 	$rv;
 }
 

      parent reply	other threads:[~2020-12-20  6:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-20  6:30 [PATCH 0/6] path usability and some tiny cleanups Eric Wong
2020-12-20  6:30 ` [PATCH 1/6] script/public-inbox-*: favor caller-provided pathnames Eric Wong
2020-12-20  6:30 ` [PATCH 2/6] inboxidle: remove needless check for {inboxdir} Eric Wong
2020-12-20  6:30 ` [PATCH 3/6] daemon: lazy load Cwd only for --daemonize users Eric Wong
2020-12-20  6:30 ` [PATCH 4/6] daemon: unconditionally call IO::Handle::blocking(0) Eric Wong
2020-12-20  6:30 ` [PATCH 5/6] daemon: kill_workers: eliminate unnecessary loop Eric Wong
2020-12-20  6:30 ` Eric Wong [this message]

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=20201220063016.20959-7-e@80x24.org \
    --to=e@80x24.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.
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).