threads / patch / 56575

patchbundle: remove ignored & undocumented "--verbose" flag

Subject: [PATCH] bundle: remove ignored & undocumented "--verbose" flag

## tl;dr

2 messages between Sep 23, 2021 and Sep 23, 2021. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Ævar Arnfjörð Bjarmason· Sep 23, 2021, 16:48 UTC · lore

In 73c3253d75e (bundle: framework for options before bundle file, 2019-11-10) the "git bundle" command was refactored to use parse_options(). In that refactoring it started understanding the "--verbose" flag before the subcommand, e.g.:

    git bundle --verbose verify --quiet

However, nothing ever did anything with this "verbose" variable, and the change wasn't documented. It appears to have been something that escaped the lab, and wasn't flagged by reviewers at the time. Let's just remove it.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---

As a follow-up to the discussion at https://lore.kernel.org/git/87zgs593ja.fsf@evledraar.gmail.com/ I looked at whether any other subcommands accepted "git cmd [opts] subcommand", here's another special-case we can safely remove.

Perhaps this was from an earlier version of https://lore.kernel.org/git/20191110204126.30553-1-robbat2@gentoo.org/, but I could not find v1 and v2.

 builtin/bundle.c | 3 ---
 1 file changed, 3 deletions(-)
Show changes to builtin/bundle.c +0 −3
diff --git a/builtin/bundle.c b/builtin/bundle.c
index 91975def2da..5a85d7cd0fe 100644
--- a/builtin/bundle.c
+++ b/builtin/bundle.c
@@ -39,8 +39,6 @@ static const char * const builtin_bundle_unbundle_usage[] = {
   NULL
 };
 
-static int verbose;
-
 static int parse_options_cmd_bundle(int argc,
 		const char **argv,
 		const char* prefix,
@@ -197,7 +195,6 @@ static int cmd_bundle_unbundle(int argc, const char **argv, const char *prefix)
 int cmd_bundle(int argc, const char **argv, const char *prefix)
 {
 	struct option options[] = {
-		OPT__VERBOSE(&verbose, N_("be verbose; must be placed before a subcommand")),
 		OPT_END()
 	};
 	int result;
-- 
2.33.0.1229.g7e7cef8c419
Taylor Blau· Sep 23, 2021, 17:38 UTC · re: Ævar Arnfjörð Bjarmason · lore

Re: [PATCH] bundle: remove ignored & undocumented "--verbose" flag

On Thu, Sep 23, 2021 at 06:48:22PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 11 quoted lines
> In 73c3253d75e (bundle: framework for options before bundle file,
> 2019-11-10) the "git bundle" command was refactored to use
> parse_options(). In that refactoring it started understanding the
> "--verbose" flag before the subcommand, e.g.:
>
>     git bundle --verbose verify --quiet
>
> However, nothing ever did anything with this "verbose" variable, and
> the change wasn't documented. It appears to have been something that
> escaped the lab, and wasn't flagged by reviewers at the time. Let's
> just remove it.

Thanks; this looks good to me. We never use the `verbose` variable for anything, and it isn't documented. So I agree that it can be removed.

Thanks for cleaning this up:
    Reviewed-by: Taylor Blau <me@ttaylorr.com>

Thanks, Taylor

← back to recent threads