git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Mahi Kassa <mahlet.takassa@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, lucasseikioshiro@gmail.com,
	jltobler@gmail.com, stolee@gmail.com,
	Mahi Kassa <mahlet.takassa@gmail.com>
Subject: [PATCH v4 1/2] repo: factor repo usage strings into shared macros
Date: Wed, 25 Mar 2026 12:51:47 +0100	[thread overview]
Message-ID: <20260325115148.101867-1-mahlet.takassa@gmail.com> (raw)
In-Reply-To: <20260323152937.257406-1- mahlet.takassa@gmail.com>

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>

---
v4:
- split the preparatory macro refactoring into its own patch
 builtin/repo.c | 14 ++++++++++----
 1 file 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);
-- 
2.34.1



       reply	other threads:[~2026-03-25 12:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260323152937.257406-1- mahlet.takassa@gmail.com>
2026-03-25 11:51 ` Mahi Kassa [this message]
2026-03-25 11:51   ` [PATCH v4 2/2] repo: show subcommand-specific help text Mahi Kassa
2026-03-25 17:40     ` Junio C Hamano
2026-03-26 14:07       ` Patrick Steinhardt
2026-03-25 17:35   ` [PATCH v4 1/2] repo: factor repo usage strings into shared macros Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260325115148.101867-1-mahlet.takassa@gmail.com \
    --to=mahlet.takassa@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jltobler@gmail.com \
    --cc=lucasseikioshiro@gmail.com \
    --cc=stolee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).