Ever since verify-pack was refactored to use `index-pack.c` in commit 3de89c9 (verify-pack: use index-pack --verify, 2011-06-06), the --stat-only option has been verifying the full pack, rather than just reading the index file, as it was originally documented to do. Allowing users to get details of packed objects rapidly without needing to hash all the objects in packfile is a useful ability. Interested consumers could use such data to more rapidly estimate the effectiveness of git's compression, such as to determine if their .gitignore is adequate, or if they should be removing additional files. However, implementing that ability would require more changes to index-pack than the author is able to do at this time, and so a quick fix to simply update the documentation to reflect current behavior is done instead. This commit also re-orders the if-else block, to ensure that if both --stat-only and --verbose are specified, the verbose details are provided. This fixes another longstanding documentation bug with `verify-pack`. Signed-off-by: Calum McConnell <calumlikesapplepie@xxxxxxxxx> --- Documentation/git-verify-pack.txt | 4 ++-- builtin/verify-pack.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/git-verify-pack.txt b/Documentation/git-verify-pack.txt index d7e8869..f734e90 100644 --- a/Documentation/git-verify-pack.txt +++ b/Documentation/git-verify-pack.txt @@ -30,8 +30,8 @@ OPTIONS -s:: --stat-only:: - Do not verify the pack contents; only show the histogram of delta - chain length. With `--verbose`, the list of objects is also shown. + As --verbose, but only show the histogram of delta + chain length. \--:: Do not interpret any more arguments as options. diff --git a/builtin/verify-pack.c b/builtin/verify-pack.c index 34e4ed7..5860a96 100644 --- a/builtin/verify-pack.c +++ b/builtin/verify-pack.c @@ -20,10 +20,10 @@ static int verify_one_pack(const char *path, unsigned int flags, const char *has strvec_push(argv, "index-pack"); - if (stat_only) - strvec_push(argv, "--verify-stat-only"); - else if (verbose) + if (verbose) strvec_push(argv, "--verify-stat"); + else if (stat_only) + strvec_push(argv, "--verify-stat-only"); else strvec_push(argv, "--verify"); -- 2.45.2