* [PATCH 2/2] solver: do not count duplicates in patch count
2022-09-02 10:11 6% [PATCH 0/2] solver: fix rename handling Eric Wong
@ 2022-09-02 10:11 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2022-09-02 10:11 UTC (permalink / raw)
To: meta
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 } ];
^ permalink raw reply related [relevance 7%]
* [PATCH 0/2] solver: fix rename handling
@ 2022-09-02 10:11 6% Eric Wong
2022-09-02 10:11 7% ` [PATCH 2/2] solver: do not count duplicates in patch count Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2022-09-02 10:11 UTC (permalink / raw)
To: meta
It takes about 5s to generate uncached, but applying 66 patches
with a copy in the middle works properly, now:
https://yhbt.net/lore/all/34d644a519c/s/?b=target/arm/helper-mve.h
Eric Wong (2):
solver: handle copies properly
solver: do not count duplicates in patch count
lib/PublicInbox/SolverGit.pm | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
^ permalink raw reply [relevance 6%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2022-09-02 10:11 6% [PATCH 0/2] solver: fix rename handling Eric Wong
2022-09-02 10:11 7% ` [PATCH 2/2] solver: do not count duplicates in patch count Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
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).