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.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE 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 3AB721F59D for ; Fri, 2 Sep 2022 10:11:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1662113509; bh=+y/oItfjRn3vg86DwQL9KP66/rqEHMB8zU6TBNdutXc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ndgfNdNVzY6vPvVWc+F3wyLLNz28VhVIFUMvUndxYG+k+9rCa5OV9ObLMU3o73Fmn PmxlKY+WlG2a9B9uYqYRT9uZIj+0lX24w0iuH6U2nOFMNhXX7QKH6NsmyQVIW/U7f5 xZk57/ESABYWoBDjRw46VLkiWxSPa2mXDU8V40vM= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/2] solver: handle copies properly Date: Fri, 2 Sep 2022 10:11:47 +0000 Message-Id: <20220902101148.20708-2-e@80x24.org> In-Reply-To: <20220902101148.20708-1-e@80x24.org> References: <20220902101148.20708-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: At least enough to get 66 patches applied to handle /lore/all/34d644a519c/s/?b=target/arm/helper-mve.h properly. I noticed this bug due to a: E: BUG: extra files in index: <100644 e91f526a1a83edb2b56798388a355b1c3729b4bd 0#011target/arm/translate-mve.c> line in my syslog However, the $TOTAL in "applying [X/$TOTAL]" in the debug log is seems off... --- lib/PublicInbox/SolverGit.pm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm index 1e96d042..610bd65b 100644 --- a/lib/PublicInbox/SolverGit.pm +++ b/lib/PublicInbox/SolverGit.pm @@ -407,18 +407,17 @@ sub mark_found ($$$) { sub parse_ls_files ($$) { my ($self, $bref) = @_; my ($qsp_err, $di) = delete @$self{qw(-qsp_err -cur_di)}; - die "git ls-files error:$qsp_err" if $qsp_err; + die "git ls-files -s -z error:$qsp_err" if $qsp_err; - my ($line, @extra) = split(/\0/, $$bref); + my @ls = split(/\0/, $$bref); + my ($line, @extra) = grep(/\t\Q$di->{path_b}\E\z/, @ls); scalar(@extra) and die "BUG: extra files in index: <", - join('> <', @extra), ">"; - + join('> <', $line, @extra), ">"; + $line // die "no \Q$di->{path_b}\E in <",join('> <', @ls), '>'; my ($info, $file) = split(/\t/, $line, 2); my ($mode_b, $oid_b_full, $stage) = split(/ /, $info); - if ($file ne $di->{path_b}) { - die + $file eq $di->{path_b} or die "BUG: index mismatch: file=$file != path_b=$di->{path_b}"; - } my $tmp_git = $self->{tmp_git} or die 'no git working tree'; my (undef, undef, $size) = $tmp_git->check($oid_b_full);