git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/1] cat-file: add mailmap subcommand to --batch-command

From
Jean-Noël AVILA <jn.avila@free.fr>
Date
Mar 31, 2026, 17:11 UTC
Message-ID
<2060629.PYKUYFuaPT@piment-oiseau>
In-Reply-To
<20260329082808.12609-2-siddharthasthana31@gmail.com>
On Sunday, 29 March 2026 10:28:08 CEST Siddharth Asthana wrote:
Show 24 quoted lines
> 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 caches git-cat-file processes and it would be useful
> if --batch-command supported toggling mailmap dynamically with existing
> processes.
> 
> Add a `mailmap` subcommand to --batch-command that takes a single
> argument: `yes` to enable mailmap and `no` to disable it. When enabled,
> mailmap data is loaded from disk on first use and kept in memory so that
> toggling back on does not require reloading.
> 
> Suggested-by: Junio C Hamano <gitster@pobox.com>
> Signed-off-by: Siddharth Asthana <siddharthasthana31@gmail.com>
> ---
> CI: https://gitlab.com/gitlab-org/git/-/pipelines/2416081861
> 
>  Documentation/git-cat-file.adoc |  7 +++++
>  builtin/cat-file.c              | 30 ++++++++++++++++++---
>  t/t4203-mailmap.sh              | 48 +++++++++++++++++++++++++++++++++
>  3 files changed, 81 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/git-cat-file.adoc b/Documentation/git-cat-
file.adoc
Show 5 quoted lines
> index c139f55a16..af32e929a8 100644
> --- a/Documentation/git-cat-file.adoc
> +++ b/Documentation/git-cat-file.adoc
> @@ -174,6 +174,13 @@ flush::
>  	since the beginning or since the last flush was issued. When `--
buffer`
>  	is used, no output will come until a `flush` is issued. When `--
buffer`
>  	is not used, commands are flushed each time without issuing `flush`.
> +
> +mailmap <yes|no>::

`yes` and `no` are keywords, and you want to express an alternative, do it like this: `mailmap (yes|no)::`.

> +	Enable or disable mailmap for subsequent `contents` and `info`
> +	commands. When `yes` is given, mailmap data is loaded from disk on
> +	first use and kept in memory; passing `yes` again does not reload 
it.
Show 5 quoted lines
> +	When `no` is given, mailmap is disabled but the data stays in memory
> +	so that a later `mailmap yes` does not need to reload it from disk.
>  --
>  +
> 

Instead of detailing the alternatives in the same chapter, you could break it into a sub-list:

Enable or disalbe mailmap for subsequent `contents` and `info` commands. Possible values are: `yes`;; mailmap data is loaded from disk on first use and kept in memory; passing `yes` again does not reload it. `no`;; mailmap is disabled but the data stays in memory so that a later `mailmap yes` does not need to reload it from disk.

Thanks
Previous: Siddharth AsthanaNext: Junio C Hamano
Message 15 of 28 in “cat-file: add use-mailmap/no-use-mailmap to --batch-command”
  1. 1/1 cat-file: add use-mailmap/no-use-mailmap to --batch-commandSiddharth Asthana, Mar 28, 2026
  2. Junio C HamanoMar 29, 2026
  3. Siddharth AsthanaMar 29, 2026
  4. Junio C HamanoMar 29, 2026
  5. 0/1 cat-file: add mailmap subcommand to --batch-commandSiddharth Asthana, Mar 29, 2026
  6. 1/1 cat-file: add mailmap subcommand to --batch-commandSiddharth Asthana, Mar 29, 2026
  7. Junio C HamanoMar 30, 2026
  8. Siddharth AsthanaMar 31, 2026
  9. Junio C HamanoMar 31, 2026
  10. Karthik NayakMar 30, 2026
  11. Siddharth AsthanaMar 31, 2026
  12. Patrick SteinhardtMar 30, 2026
  13. Junio C HamanoMar 30, 2026
  14. Siddharth AsthanaMar 31, 2026
  15. Jean-Noël AVILAMar 31, 2026
  16. Junio C HamanoMar 31, 2026
  17. Jean-Noël AvilaApr 1, 2026
  18. 0/1 cat-file: add mailmap subcommand to --batch-commandSiddharth Asthana, Mar 31, 2026
  19. 1/1 cat-file: add mailmap subcommand to --batch-commandSiddharth Asthana, Mar 31, 2026
  20. Junio C HamanoMar 31, 2026
  21. Junio C HamanoApr 10, 2026
  22. 0/1 cat-file: add mailmap subcommand to --batch-commandSiddharth Asthana, Apr 15, 2026
  23. 1/1 cat-file: add mailmap subcommand to --batch-commandSiddharth Asthana, Apr 15, 2026
  24. Junio C HamanoApr 15, 2026
  25. Siddharth AsthanaApr 16, 2026
  26. 0/1 cat-file: add mailmap subcommand to --batch-commandSiddharth Asthana, Apr 16, 2026
  27. 1/1 cat-file: add mailmap subcommand to --batch-commandSiddharth Asthana, Apr 16, 2026
  28. Junio C HamanoMay 20, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.