From: Junio C Hamano <gitster@pobox.com>
To: Mahi Kassa <mahlet.takassa@gmail.com>
Cc: git@vger.kernel.org, lucasseikioshiro@gmail.com,
jltobler@gmail.com, stolee@gmail.com
Subject: Re: [PATCH v4 1/2] repo: factor repo usage strings into shared macros
Date: Wed, 25 Mar 2026 10:35:17 -0700 [thread overview]
Message-ID: <xmqqqzp7vmlm.fsf@gitster.g> (raw)
In-Reply-To: <20260325115148.101867-1-mahlet.takassa@gmail.com> (Mahi Kassa's message of "Wed, 25 Mar 2026 12:51:47 +0100")
Mahi Kassa <mahlet.takassa@gmail.com> writes:
> 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(-)
Looking good. The distribution of commas are sensible, too.
> 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);
prev parent reply other threads:[~2026-03-25 17:35 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 ` [PATCH v4 1/2] repo: factor repo usage strings into shared macros Mahi Kassa
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 ` Junio C Hamano [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqqzp7vmlm.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jltobler@gmail.com \
--cc=lucasseikioshiro@gmail.com \
--cc=mahlet.takassa@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox