]> git.ipfire.org Git - thirdparty/git.git/commit
fsck: suppress MIDX output with `--no-progress`
authorTaylor Blau <me@ttaylorr.com>
Sat, 8 Jul 2023 00:31:34 +0000 (20:31 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Jul 2023 17:02:40 +0000 (10:02 -0700)
commit39bdd30377c18cf52da08441bb2cf2a354f0e5bb
tree048153c748c1609c35aa17c0d3a687642571c5b9
parenteda206f61125ec5e0985809c1cf0a853abca2ae7
fsck: suppress MIDX output with `--no-progress`

In a similar spirit as the previous commit, address a bug where `git
fsck` produces output when calling `git multi-pack-index verify` even
when invoked with `--no-progress`.

    $ git.compile fsck --connectivity-only --no-progress --no-dangling
    Verifying OID order in multi-pack-index: 100% (605677/605677), done.
    Sorting objects by packfile: 100% (605678/605678), done.
    Verifying object offsets: 100% (605678/605678), done.

The three lines produced by `git fsck` come from `git multi-pack-index
verify`, but should be squelched due to `--no-progress`.

The MIDX machinery learned to generate these progress messages as early
as 430efb8a74b (midx: add progress indicators in multi-pack-index
verify, 2019-03-21), but did not respect `--progress` or `--no-progress`
until ad60096d1c8 (midx: honor the MIDX_PROGRESS flag in
verify_midx_file, 2019-10-21).

But the `git multi-pack-index verify` step was added to fsck in
66ec0390e75 (fsck: verify multi-pack-index, 2018-09-13), pre-dating any
of the above patches.

Pass `--[no-]progress` as appropriate to ensure that we don't produce
output when told not to.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fsck.c
t/t5319-multi-pack-index.sh