]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/index-pack.c
index-pack: restore "resolving deltas" progress meter
authorJeff King <peff@peff.net>
Wed, 7 Oct 2020 18:19:23 +0000 (14:19 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 7 Oct 2020 18:50:09 +0000 (11:50 -0700)
commitcea69151a4d4c0861a6dd5006267141b04ebbadb
tree22d82cbcbf58bc82e9ba5805d07ee31be77083aa
parentf08cbf60fe11507b5ff722ceae95dfb86ce654ee
index-pack: restore "resolving deltas" progress meter

Commit f08cbf60fe (index-pack: make quantum of work smaller, 2020-09-08)
refactored the main loop in threaded_second_pass(), but also deleted the
call to display_progress() at the top of the loop. This means that users
typically see no progress at all during the delta resolution phase (and
for large repositories, Git appears to hang).

This looks like an accident that was unrelated to the intended change of
that commit, since we continue to update nr_resolved_deltas in
resolve_delta(). Let's restore the call to get that progress back.

We'll also add a test that confirms we generate the expected progress.
This isn't perfect, as it wouldn't catch a bug where progress was
delayed to the end. That was probably possible to trigger when receiving
a thin pack, because we'd eventually call display_progress() from
fix_unresolved_deltas(), but only once after doing all the work.
However, since our test case generates a complete pack, it reliably
demonstrates this particular bug and its fix. And we can't do better
without making the test racy.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/index-pack.c
t/t5302-pack-index.sh