• S
    Teach prune-packed to use the standard progress meter · b5d72f0a
    Shawn O. Pearce 提交于
    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: NShawn O. Pearce <spearce@spearce.org>
    b5d72f0a
builtin-prune-packed.c 1.9 KB