aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMahi Kassa <mahlet.takassa@gmail.com>2026-03-25 12:51:47 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-25 10:35:27 -0700
commit4be77c732c9951a60f743af04a5906fdc41c5795 (patch)
tree232d79097ca5354e538c4e0bdc48941bdcdeccd8
parentce74208c2fa13943fffa58f168ac27a76d0eb789 (diff)
downloadgit-4be77c732c9951a60f743af04a5906fdc41c5795.tar.xz
repo: factor repo usage strings into shared macros
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>
-rw-r--r--builtin/repo.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/builtin/repo.c b/builtin/repo.c
index 55f9b9095c..b5146499d0 100644
--- a/builtin/repo.c
+++ b/builtin/repo.c
@@ -20,11 +20,17 @@
#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);