Re: [PATCH v2 1/1] cat-file: add mailmap subcommand to --batch-command
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Mar 30, 2026, 10:37 UTC
- Message-ID
- <acpSgZ8RgBIE-h1Q@pks.im>
- In-Reply-To
- <20260329082808.12609-2-siddharthasthana31@gmail.com>
On Sun, Mar 29, 2026 at 01:58:08PM +0530, Siddharth Asthana wrote:
Show 25 quoted lines
> diff --git a/builtin/cat-file.c b/builtin/cat-file.c
> index b6f12f41d6..a53926d2bb 100644
> --- a/builtin/cat-file.c
> +++ b/builtin/cat-file.c
> @@ -692,6 +693,24 @@ static void parse_cmd_info(struct batch_options *opt,
> batch_one_object(line, output, opt, data);
> }
>
> +static void parse_cmd_mailmap(struct batch_options *opt UNUSED,
> + const char *line,
> + struct strbuf *output UNUSED,
> + struct expand_data *data UNUSED)
> +{
> + if (!strcmp(line, "yes")) {
> + if (!mailmap_loaded) {
> + read_mailmap(the_repository, &mailmap);
> + mailmap_loaded = 1;
> + }
> + use_mailmap = 1;
> + } else if (!strcmp(line, "no")) {
> + use_mailmap = 0;
> + } else {
> + die(_("mailmap: unknown argument '%s', expected 'yes' or 'no'"), line);
> + }
> +}Not commenting on the overall chanegchange, but I guess we should use `git_parse_maybe_bool()` here?
Patrick