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 6BB821F601 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=+mL+J4nApnklTV3d5kYFZz4zH+6wz6eX6/liXQV3es0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZED7kimue3Pj8wDlJjQFottaQDGqo42TohAIgL2qHCJ2J252fYrqEcy6Zakd/fuIu XaisxIt8TG2hl4L3kHWiRmPBVUj1G7nF5WLXi+SKY+CtV8amlsCRn7M2T7bx775BPm OVByKp/xCP7GdeFP6SrdZlibVnJfM+ne7qnC+aoM= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/2] solver: do not count duplicates in patch count Date: Fri, 2 Sep 2022 10:11:48 +0000 Message-Id: <20220902101148.20708-3-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: We're considering duplicate patches from cross-posted lists identical, so don't double-count them when displaying the "applying [X/Y]" message since (successful) duplicates get skipped. --- lib/PublicInbox/SolverGit.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm index 610bd65b..ac655f34 100644 --- a/lib/PublicInbox/SolverGit.pm +++ b/lib/PublicInbox/SolverGit.pm @@ -486,15 +486,14 @@ sub do_git_apply ($) { my @cmd = (qw(git apply --cached --ignore-whitespace --unidiff-zero --whitespace=warn --verbose)); my $len = length(join(' ', @cmd)); - my $total = $self->{tot}; my $di; # keep track of the last one for "git ls-files" my $prv_oid_b; do { my $i = ++$self->{nr}; $di = shift @$patches; - dbg($self, "\napplying [$i/$total] " . di_url($self, $di) . - "\n" . $di->{hdr_lines}); + dbg($self, "\napplying [$i/$self->{nr_p}] " . + di_url($self, $di) . "\n" . $di->{hdr_lines}); my $path = $di->{n}; $len += length($path) + 1; push @cmd, $path; @@ -557,6 +556,7 @@ sub extract_diffs_done { unshift @{$self->{patches}}, @$diffs; dbg($self, "found $want->{oid_b} in " . join(" ||\n\t", map { di_url($self, $_) } @$diffs)); + ++$self->{nr_p}; # good, we can find a path to the oid we $want, now # lets see if we need to apply more patches: @@ -679,7 +679,7 @@ sub solve ($$$$$) { $self->{oid_want} = $oid_want; $self->{out} = $out; $self->{seen_oid} = {}; - $self->{tot} = 0; + $self->{tot} = $self->{nr_p} = 0; $self->{psgi_env} = $env; $self->{have_hints} = 1 if scalar keys %$hints; $self->{todo} = [ { %$hints, oid_b => $oid_want } ];