Teach prune-packed to use the standard progress meter
commitb5d72f0a4cd3cce945ca0d37e4fa0ebbfcdcdb52
authorShawn O. Pearce <spearce@spearce.org>
Fri, 19 Oct 2007 04:08:37 +0000 (19 00:08 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Fri, 19 Oct 2007 04:28:44 +0000 (19 00:28 -0400)
tree96460b1055e66952392706d748ae556680fe5643
parent9c60a966f2c3784cdff31aa6ad9f2086df64d5ba
Teach prune-packed to use the standard progress meter

Rather than reimplementing the progress meter logic and always
showing 100 lines of output while pruning already packed objects
we now use a delayed progress meter and only show it if there are
enough objects to make us take a little while.

Most users won't see the message anymore as it usually doesn't take
very long to delete the already packed loose objects.  This neatens
the output of a git-gc or git-repack execution, which is especially
important for a `git gc --auto` triggered from within another
command.

We perform the display_progress() call from within the very innermost
loop in case we spend more than 1 second within any single object
directory.  This ensures that a progress_update event from the
timer will still trigger in a timely fashion and allow the user to
see the progress meter.

While I'm in here I changed the message to be more descriptive of
its actual task.  "Removing unused objects" is a little scary for
new users as they wonder where these unused objects came from and
how they should avoid them.  Truth is these objects aren't unused
in the sense of what git-prune would call a dangling object, these
are used but are just duplicates of things we have already stored
in a packfile.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
builtin-prune-packed.c