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 <robbat2-20190806T191156-796782357Z@orbis-terrarum.net> Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Robin H. Johnson committed
Nov 10, 2019 at 12:41 UTC
e0eba649e8c2a4271e3bcfb9ebcd358900d425c9
2 files changed
+7
-4
Documentation/git-bundle.txt
+1
-1
@@ -10,7 +10,7 @@ SYNOPSIS
10
--------
11
[verse]
12
'git bundle' create [-q | --quiet | --progress | --all-progress] [--all-progress-implied] <file> <git-rev-list-args>
13
-'git bundle' verify <file>
13
+'git bundle' verify [-q | --quiet] <file>
14
'git bundle' list-heads <file> [<refname>...]
15
'git bundle' unbundle <file> [<refname>...]
16
builtin/bundle.c
+6
-3
@@ -13,7 +13,7 @@
13
14
static const char * const builtin_bundle_usage[] = {
15
N_("git bundle create [<options>] <file> <git-rev-list args>"),
16
- N_("git bundle verify <file>"),
16
+ N_("git bundle verify [<options>] <file>"),
17
N_("git bundle list-heads <file> [<refname>...]"),
18
N_("git bundle unbundle <file> [<refname>...]"),
19
NULL
@@ -25,7 +25,7 @@ static const char * const builtin_bundle_create_usage[] = {
25
};
26
27
static const char * const builtin_bundle_verify_usage[] = {
28
- N_("git bundle verify <file>"),
28
+ N_("git bundle verify [<options>] <file>"),
29
NULL
30
};
31
@@ -97,8 +97,11 @@ static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {
97
static int cmd_bundle_verify(int argc, const char **argv, const char *prefix) {
98
struct bundle_header header;
99
int bundle_fd = -1;
100
+ int quiet = 0;
101
102
struct option options[] = {
103
+ OPT_BOOL('q', "quiet", &quiet,
104
+ N_("do not show bundle details")),
105
OPT_END()
106
};
107
const char* bundle_file;
@@ -111,7 +114,7 @@ static int cmd_bundle_verify(int argc, const char **argv, const char *prefix) {
114
if ((bundle_fd = read_bundle_header(bundle_file, &header)) < 0)
115
return 1;
116
close(bundle_fd);
114
- if (verify_bundle(the_repository, &header, 1))
117
+ if (verify_bundle(the_repository, &header, !quiet))
118
return 1;
119
fprintf(stderr, _("%s is okay\n"), bundle_file);
120
return 0;