summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2014-03-14 22:26:58 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-03-17 15:01:27 -0700
commit78d2214eb4d10ea1e30dd7e69a4e6d73d9f66164 (patch)
tree82752edf18c40cf738ac52c8bb362de1446e7a75 /builtin
parentpack-objects: show progress for reused packfiles (diff)
downloadtgif-78d2214eb4d10ea1e30dd7e69a4e6d73d9f66164.tar.xz
pack-objects: show reused packfile objects in "Counting objects"
When we are sending a pack for push or fetch, we may reuse a chunk of packfile without even parsing it. The progress meter then looks like this: Reusing existing pack: 3440489, done. Counting objects: 3, done. The first line shows that we are reusing a large chunk of objects, and then we further count any objects not included in the reused portion with an actual traversal. These are all implementation details that the user does not need to care about. Instead, we can show the reused objects in the normal "counting..." progress meter (which will simply go much faster than normal), and then continue to add to it as we traverse. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/pack-objects.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index f0474db991..021ec7ad79 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1028,7 +1028,7 @@ static int add_object_entry(const unsigned char *sha1, enum object_type type,
exclude, name && no_try_delta(name),
index_pos, found_pack, found_offset);
- display_progress(progress_state, to_pack.nr_objects);
+ display_progress(progress_state, nr_result);
return 1;
}
@@ -1044,7 +1044,7 @@ static int add_object_entry_from_bitmap(const unsigned char *sha1,
create_object_entry(sha1, type, name_hash, 0, 0, index_pos, pack, offset);
- display_progress(progress_state, to_pack.nr_objects);
+ display_progress(progress_state, nr_result);
return 1;
}
@@ -2446,12 +2446,7 @@ static int get_object_list_from_bitmap(struct rev_info *revs)
&reuse_packfile_offset)) {
assert(reuse_packfile_objects);
nr_result += reuse_packfile_objects;
-
- if (progress) {
- fprintf(stderr, "Reusing existing pack: %d, done.\n",
- reuse_packfile_objects);
- fflush(stderr);
- }
+ display_progress(progress_state, nr_result);
}
traverse_bitmap_commit_list(&add_object_entry_from_bitmap);