]> git.ipfire.org Git - thirdparty/git.git/commitdiff
repo: factor repo usage strings into shared macros
authorMahi Kassa <mahlet.takassa@gmail.com>
Wed, 25 Mar 2026 11:51:47 +0000 (12:51 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Mar 2026 17:35:27 +0000 (10:35 -0700)
Factor the "git repo info" and "git repo structure" usage
strings into shared macros so they can be reused in multiple
usage arrays.

This is a preparatory refactoring for subsequent changes to
subcommand-specific help output.

Signed-off-by: Mahi Kassa <mahlet.takassa@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/repo.c

index 55f9b9095c1f92d0782cb2daee4c7ed193b22df6..b5146499d08d332746db42868d3ff15950166b91 100644 (file)
 #include "tree-walk.h"
 #include "utf8.h"
 
+#define REPO_INFO_USAGE \
+       "git repo info [--format=(lines|nul) | -z] [--all | <key>...]", \
+       "git repo info --keys [--format=(lines|nul) | -z]"
+
+#define REPO_STRUCTURE_USAGE \
+       "git repo structure [--format=(table|lines|nul) | -z]"
+
 static const char *const repo_usage[] = {
-       "git repo info [--format=(lines|nul) | -z] [--all | <key>...]",
-       "git repo info --keys [--format=(lines|nul) | -z]",
-       "git repo structure [--format=(table|lines|nul) | -z]",
-       NULL
+       REPO_INFO_USAGE,
+       REPO_STRUCTURE_USAGE,
+       NULL,
 };
 
 typedef int get_value_fn(struct repository *repo, struct strbuf *buf);