Thread (45 messages) 45 messages, 6 authors, 2022-04-08
STALE1527d

[PATCH 02/25] bundle: alphabetize subcommands better

From: Derrick Stolee via GitGitGadget <hidden>
Date: 2022-02-23 18:31:15
Subsystem: the rest · Maintainer: Linus Torvalds

From: Derrick Stolee <redacted>

The usage strings for the 'git bundle' subcommands are not alphabetical.
This also applies to their inspection within cmd_bundle(). Fix this
ordering before we insert a new subcommand.

This change does not reorder the cmd_bundle_*() methods to avoid moving
lines that are more likely wanted in a future 'git blame' call. It is
fine that those longer methods are not ordered alphabetically.

Signed-off-by: Derrick Stolee <redacted>
---
 builtin/bundle.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/builtin/bundle.c b/builtin/bundle.c
index 5a85d7cd0fe..8187b7df739 100644
--- a/builtin/bundle.c
+++ b/builtin/bundle.c
@@ -13,9 +13,9 @@
 
 static const char * const builtin_bundle_usage[] = {
   N_("git bundle create [<options>] <file> <git-rev-list args>"),
-  N_("git bundle verify [<options>] <file>"),
   N_("git bundle list-heads <file> [<refname>...]"),
   N_("git bundle unbundle <file> [<refname>...]"),
+  N_("git bundle verify [<options>] <file>"),
   NULL
 };
 
@@ -24,11 +24,6 @@ static const char * const builtin_bundle_create_usage[] = {
   NULL
 };
 
-static const char * const builtin_bundle_verify_usage[] = {
-  N_("git bundle verify [<options>] <file>"),
-  NULL
-};
-
 static const char * const builtin_bundle_list_heads_usage[] = {
   N_("git bundle list-heads <file> [<refname>...]"),
   NULL
@@ -39,6 +34,11 @@ static const char * const builtin_bundle_unbundle_usage[] = {
   NULL
 };
 
+static const char * const builtin_bundle_verify_usage[] = {
+  N_("git bundle verify [<options>] <file>"),
+  NULL
+};
+
 static int parse_options_cmd_bundle(int argc,
 		const char **argv,
 		const char* prefix,
@@ -209,12 +209,12 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
 
 	else if (!strcmp(argv[0], "create"))
 		result = cmd_bundle_create(argc, argv, prefix);
-	else if (!strcmp(argv[0], "verify"))
-		result = cmd_bundle_verify(argc, argv, prefix);
 	else if (!strcmp(argv[0], "list-heads"))
 		result = cmd_bundle_list_heads(argc, argv, prefix);
 	else if (!strcmp(argv[0], "unbundle"))
 		result = cmd_bundle_unbundle(argc, argv, prefix);
+	else if (!strcmp(argv[0], "verify"))
+		result = cmd_bundle_verify(argc, argv, prefix);
 	else {
 		error(_("Unknown subcommand: %s"), argv[0]);
 		usage_with_options(builtin_bundle_usage, options);
-- 
gitgitgadget
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help