unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: Re: [PATCH 1/2] git: use --batch-command in git 2.36+ to save processes
Date: Fri, 27 Jan 2023 08:17:23 +0000	[thread overview]
Message-ID: <20230127081723.M796329@dcvr> (raw)
In-Reply-To: <20230127081421.M411750@dcvr>

t/nntpd.t and t/nntpd-v2.t also need a fix on my 32-bit machine
which lacks libgit2 (and in retrospect, same problem w/ the previous
fix for t/imapd.t)

The change to PublicInbox/Git.pm isn't necessary, but it looks a
bit nicer since I stopped passing `--' in to that sub and only
add `--' when invoking the command.

diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index a9db8ad7..3e2b435c 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -157,7 +157,7 @@ sub _bidi_pipe {
 	my @cmd = ($GIT_EXE, "--git-dir=$gd", '-c', "core.abbrev=$abbr",
 			'cat-file', "--$batch");
 	if ($err) {
-		my $id = "git.$self->{git_dir}$batch.err";
+		my $id = "git.$self->{git_dir}.$batch.err";
 		my $fh = tmpfile($id) or $self->fail("tmpfile($id): $!");
 		$self->{$err} = $fh;
 		$rdr->{2} = $fh;
diff --git a/t/nntpd.t b/t/nntpd.t
index 30233ce0..bebf4203 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -365,7 +365,7 @@ Date: Fri, 02 Oct 1993 00:00:00 +0000
 		($^O =~ /\A(?:linux)\z/) or
 			skip "lsof /(deleted)/ check untested on $^O", 1;
 		my @lsof = xqx([$lsof, '-p', $td->{pid}], undef, $noerr);
-		my $d = [ grep(/\(deleted\)/, @lsof) ];
+		my $d = [ grep(/\(deleted\)/, grep(!/batch-command\.err/, @lsof)) ];
 		is_deeply($d, [], 'no deleted files') or diag explain($d);
 	};
 	SKIP: { test_watch($tmpdir, $host_port, $group) };

  reply	other threads:[~2023-01-27  8:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-26  9:32 [PATCH 0/2] use `git cat-file --batch-command' if available Eric Wong
2023-01-26  9:32 ` [PATCH 1/2] git: use --batch-command in git 2.36+ to save processes Eric Wong
2023-01-27  8:14   ` Eric Wong
2023-01-27  8:17     ` Eric Wong [this message]
2023-02-09  1:29   ` Eric Wong
2023-02-20  8:19     ` [PATCH] git_async_cat: don't mis-abort replaced process Eric Wong
2023-01-26  9:32 ` [PATCH 2/2] git: drop needless checks for old git Eric Wong

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=20230127081723.M796329@dcvr \
    --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).