git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] commit-graph: increment progress indicator
@ 2024-06-11 15:09 Johannes Schindelin via GitGitGadget
  2024-06-12  7:14 ` Patrick Steinhardt
  2024-06-12 14:43 ` Taylor Blau
  0 siblings, 2 replies; 4+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2024-06-11 15:09 UTC (permalink / raw)
  To: git; +Cc: Derrick Stolee, Johannes Schindelin, Derrick Stolee

From: Derrick Stolee <derrickstolee@github.com>

This fixes a bug that was introduced by 368d19b0b7 (commit-graph:
refactor compute_topological_levels(), 2023-03-20): Previously, the
progress indicator was updated from `i + 1` where `i` is the loop
variable of the enclosing `for` loop. After this patch, the update used
`info->progress_cnt + 1` instead, however, unlike `i`, the
`progress_cnt` attribute was not incremented. Let's increment it.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
    commit-graph: fix a progress indicator bug
    
    Stolee noticed this bug when integrating the for-each-ref --ahead-behind
    patches into GitHub's internal fork of Git, and fixed it. For a variety
    of reasons, upstreaming this fix fell between the cracks. Until now.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1743%2Fdscho%2Fincrement-progress-in-commit-graph-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1743/dscho/increment-progress-in-commit-graph-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1743

 commit-graph.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commit-graph.c b/commit-graph.c
index e5dd3553dfe..41a2e1b4c6d 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -1597,7 +1597,7 @@ static void compute_reachable_generation_numbers(
 		timestamp_t gen;
 		repo_parse_commit(info->r, c);
 		gen = info->get_generation(c, info->data);
-		display_progress(info->progress, info->progress_cnt + 1);
+		display_progress(info->progress, ++info->progress_cnt);
 
 		if (gen != GENERATION_NUMBER_ZERO && gen != GENERATION_NUMBER_INFINITY)
 			continue;

base-commit: 7b0defb3915eaa0bd118f0996e8c00b4eb2dc1ca
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-12 14:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-11 15:09 [PATCH] commit-graph: increment progress indicator Johannes Schindelin via GitGitGadget
2024-06-12  7:14 ` Patrick Steinhardt
2024-06-12  8:26   ` Johannes Schindelin
2024-06-12 14:43 ` Taylor Blau

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 NNTP newsgroup(s).