From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id EBEE31F453 for ; Mon, 21 Jan 2019 20:52:57 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 19/37] solver: note the synchronous nature of index preparation Date: Mon, 21 Jan 2019 20:52:35 +0000 Message-Id: <20190121205253.10455-20-e@80x24.org> In-Reply-To: <20190121205253.10455-1-e@80x24.org> References: <20190121205253.10455-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It's not likely to be worth our time to support a callback-driven model for something which happens once per patch series. --- lib/PublicInbox/SolverGit.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm index 51be2cd..42bb603 100644 --- a/lib/PublicInbox/SolverGit.pm +++ b/lib/PublicInbox/SolverGit.pm @@ -221,11 +221,13 @@ sub prepare_index ($$$$) { my ($r, $w); my $path_a = $di->{path_a} or die "BUG: path_a missing for $oid_full"; my $mode_a = $di->{mode_a} || extract_old_mode($di); - my @git = (qw(git -C), $wt_dir); + # unlike git-apply(1), this only gets called once in a patch + # series and happens too quickly to be worth making async: pipe($r, $w) or die "pipe: $!"; my $rdr = { 0 => fileno($r) }; - my $pid = spawn([@git, qw(update-index -z --index-info)], {}, $rdr); + my $pid = spawn([qw(git -C), $wt_dir, + qw(update-index -z --index-info)], undef, $rdr); close $r or die "close pipe(r): $!"; print $w "$mode_a $oid_full\t$path_a\0" or die "print update-index: $!"; -- EW