commit-graph write: add more descriptive progress output
commit7c7b8a7fc7c87011d5b3e384122ce8b23ef280e8
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sat, 19 Jan 2019 20:21:18 +0000 (19 21:21 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 Jan 2019 21:14:08 +0000 (23 13:14 -0800)
treeb694f00ec1ec7fa4556dcf147bf134b39637844e
parentd9b1b309cfc0ebbe5ac689e1131f8c85b025c8c7
commit-graph write: add more descriptive progress output

Make the progress output shown when we're searching for commits to
include in the graph more descriptive. This amends code I added in
7b0f229222 ("commit-graph write: add progress output", 2018-09-17).

Now, on linux.git, we'll emit this sort of output in the various modes
we support:

    $ git commit-graph write
    Finding commits for commit graph among packed objects: 100% (6529159/6529159), done.
    [...]

    # Actually we don't emit this since this takes almost no time at
    # all. But if we did (s/_delayed//) we'd show:
    $ git for-each-ref --format='%(objectname)' | git commit-graph write --stdin-commits
    Finding commits for commit graph from 630 refs: 100% (630/630), done.
    [...]

    $ (cd .git/objects/pack/ && ls *idx) | git commit-graph write --stdin-pack
    Finding commits for commit graph in 3 packs: 6529159, done.
    [...]

The middle on of those is going to be the output users might see in
practice, since it'll be emitted when they get the commit graph via
gc.writeCommitGraph=true. But as noted above you need a really large
number of refs for this message to show. It'll show up on a test
repository I have with ~165k refs:

    Finding commits for commit graph from 165203 refs: 100% (165203/165203), done.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-graph.c