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 1/2] solver: handle copies properly
Date: Fri,  2 Sep 2022 10:11:47 +0000	[thread overview]
Message-ID: <20220902101148.20708-2-e@80x24.org> (raw)
In-Reply-To: <20220902101148.20708-1-e@80x24.org>

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);

  reply	other threads:[~2022-09-02 10:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02 10:11 [PATCH 0/2] solver: fix rename handling Eric Wong
2022-09-02 10:11 ` Eric Wong [this message]
2022-09-02 10:11 ` [PATCH 2/2] solver: do not count duplicates in patch count 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=20220902101148.20708-2-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).