]> git.ipfire.org Git - thirdparty/git.git/commit
cat-file: add mailmap subcommand to --batch-command
authorSiddharth Asthana <siddharthasthana31@gmail.com>
Thu, 16 Apr 2026 03:32:50 +0000 (09:02 +0530)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Apr 2026 03:42:08 +0000 (20:42 -0700)
commit6da647d8522641f932528de0167413719a38a2c0
treea6d4036b9a6a62afbf284ba60c8b05d8ccc12c20
parent5361983c075154725be47b65cca9a2421789e410
cat-file: add mailmap subcommand to --batch-command

git-cat-file(1)'s --batch-command works with the --use-mailmap option,
but this option needs to be set when the process is created. This means
we cannot change this option mid-operation.

At GitLab, Gitaly keeps interacting with a long-lived git-cat-file
process and it would be useful if --batch-command supported toggling
mailmap dynamically on an existing process.

Add a `mailmap` subcommand to --batch-command that takes a boolean
argument (usual ways you can specify a boolean value like 'yes', 'true',
etc., are supported). Mailmap data is loaded lazily and kept in memory,
while a helper centralizes the one-time load path used both at startup
and from the batch-command handler.

Extend tests to cover runtime toggling, startup option interactions
(`--mailmap`/`--no-mailmap`), accepted boolean forms, and invalid values.

Signed-off-by: Siddharth Asthana <siddharthasthana31@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-cat-file.adoc
builtin/cat-file.c
t/t4203-mailmap.sh