From: Robin H. Johnson Date: Sun, 10 Nov 2019 20:41:26 +0000 (-0800) Subject: bundle-verify: add --quiet X-Git-Tag: v2.25.0-rc0~109^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0eba649e8c2a4271e3bcfb9ebcd358900d425c9;p=thirdparty%2Fgit.git bundle-verify: add --quiet Add --quiet to git-bundle verify as proposed on the mailing list [1]. Reference: https://www.mail-archive.com/git@vger.kernel.org/msg182844.html Signed-off-by: Robin H. Johnson Signed-off-by: Junio C Hamano --- diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt index 96bb94df7b..ccada80a4a 100644 --- a/Documentation/git-bundle.txt +++ b/Documentation/git-bundle.txt @@ -10,7 +10,7 @@ SYNOPSIS -------- [verse] 'git bundle' create [-q | --quiet | --progress | --all-progress] [--all-progress-implied] -'git bundle' verify +'git bundle' verify [-q | --quiet] 'git bundle' list-heads [...] 'git bundle' unbundle [...] diff --git a/builtin/bundle.c b/builtin/bundle.c index 39b3e88d40..f049d27a14 100644 --- a/builtin/bundle.c +++ b/builtin/bundle.c @@ -13,7 +13,7 @@ static const char * const builtin_bundle_usage[] = { N_("git bundle create [] "), - N_("git bundle verify "), + N_("git bundle verify [] "), N_("git bundle list-heads [...]"), N_("git bundle unbundle [...]"), NULL @@ -25,7 +25,7 @@ static const char * const builtin_bundle_create_usage[] = { }; static const char * const builtin_bundle_verify_usage[] = { - N_("git bundle verify "), + N_("git bundle verify [] "), NULL }; @@ -97,8 +97,11 @@ static int cmd_bundle_create(int argc, const char **argv, const char *prefix) { static int cmd_bundle_verify(int argc, const char **argv, const char *prefix) { struct bundle_header header; int bundle_fd = -1; + int quiet = 0; struct option options[] = { + OPT_BOOL('q', "quiet", &quiet, + N_("do not show bundle details")), OPT_END() }; const char* bundle_file; @@ -111,7 +114,7 @@ static int cmd_bundle_verify(int argc, const char **argv, const char *prefix) { if ((bundle_fd = read_bundle_header(bundle_file, &header)) < 0) return 1; close(bundle_fd); - if (verify_bundle(the_repository, &header, 1)) + if (verify_bundle(the_repository, &header, !quiet)) return 1; fprintf(stderr, _("%s is okay\n"), bundle_file); return 0;