]> git.ipfire.org Git - thirdparty/git.git/commitdiff
bundle-verify: add --quiet
authorRobin H. Johnson <robbat2@gentoo.org>
Sun, 10 Nov 2019 20:41:26 +0000 (12:41 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 11 Nov 2019 02:46:29 +0000 (11:46 +0900)
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 <robbat2-20190806T191156-796782357Z@orbis-terrarum.net>
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-bundle.txt
builtin/bundle.c

index 96bb94df7b1fe9b74415b1804f6aeacf9de94b9b..ccada80a4a4c9813804372b7b167f0015a7ec3a7 100644 (file)
@@ -10,7 +10,7 @@ SYNOPSIS
 --------
 [verse]
 'git bundle' create [-q | --quiet | --progress | --all-progress] [--all-progress-implied] <file> <git-rev-list-args>
-'git bundle' verify <file>
+'git bundle' verify [-q | --quiet] <file>
 'git bundle' list-heads <file> [<refname>...]
 'git bundle' unbundle <file> [<refname>...]
 
index 39b3e88d40aad4fc10d79ed8ca47fa5b563bd563..f049d27a14405d540902ba5d368a59d670f7f614 100644 (file)
@@ -13,7 +13,7 @@
 
 static const char * const builtin_bundle_usage[] = {
   N_("git bundle create [<options>] <file> <git-rev-list args>"),
-  N_("git bundle verify <file>"),
+  N_("git bundle verify [<options>] <file>"),
   N_("git bundle list-heads <file> [<refname>...]"),
   N_("git bundle unbundle <file> [<refname>...]"),
   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 <file>"),
+  N_("git bundle verify [<options>] <file>"),
   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;