]> git.ipfire.org Git - thirdparty/git.git/commit
progress: add sparse mode to force 100% complete message
authorJeff Hostetler <jeffhost@microsoft.com>
Thu, 21 Mar 2019 19:36:11 +0000 (12:36 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 22 Mar 2019 05:31:11 +0000 (14:31 +0900)
commit9d81ecb52b5e6611f66c968884dde42928350b18
tree762baf04aebc7ddffe2dc196e7a3946c4a086867
parent041f5ea1cf987a4068ef5f39ba0a09be85952064
progress: add sparse mode to force 100% complete message

Add new start_sparse_progress() and start_delayed_sparse_progress()
constructors and "sparse" flag to struct progress.

Teach stop_progress() to force a 100% complete progress message before
printing the final "done" message when "sparse" is set.

Calling display_progress() for every item in a large set can
be expensive.  If callers try to filter this for performance
reasons, such as emitting every k-th item, progress would
not reach 100% unless they made a final call to display_progress()
with the item count before calling stop_progress().

Now this is automatic when "sparse" is set.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
progress.c
progress.h