Re: [PATCH v2 1/1] cat-file: add mailmap subcommand to --batch-command
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 30, 2026, 14:53 UTC
- Message-ID
- <xmqqpl4lfjw8.fsf@gitster.g>
- In-Reply-To
- <acpSgZ8RgBIE-h1Q@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 29 quoted lines
> On Sun, Mar 29, 2026 at 01:58:08PM +0530, Siddharth Asthana wrote:
>> 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?The saame thought occureed to me. Also I agree with Karthik that we should not say "applies only to this and that commands".
Thanks, all.