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

Re: Is there a way to get the "format-patch" formatted file name?

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 1, 2023, 15:53 UTC
Message-ID
<xmqqwmx9ritx.fsf@gitster.g>
In-Reply-To
<ZPHEOYyyX+l3AGP1@ugly>
Oswald Buddenhagen <oswald.buddenhagen@gmx.de> writes:
> but i wouldn't be opposed to for example git-mailinfo learning to
> understand the --pretty argument, if the implementation doesn't turn
> out to be completely out of proportion.

Excellent suggestion. I agree that 'mailinfo' would be the closest place we have for such a new feature. It's "info" output (i.e. what comes out to the standard output of the command) is designed to be extensible, and I vaguely recall that we indeed have added new field(s) during its lifetime with existing users already.

We can just invent a new label (e.g. "Filesystem-safe-subject:"), pass the subject string to pretty.c:format_sanitized_subject() and emit the result next to the existing "Subject:" with that label, and we can even do so unconditionally without breaking anybody.

Having it in 'mailinfo' may still not be a good solution to the issue, given that Vit says

>> But I typically don't have a Git.
though.

On a related not-so-distant tangent, we probably should redo the support for --message-id to emit it as an extra entry to the "info" output, instead of contaminating the "message" output. The option was added only to support "git am --message-id", and as long as the calling "am" and "mailinfo" are updated in sync to use the "info" output to carry the Message-Id: information, we should be able to do such a clean-up without changing the externally visible behaviour.

Previous: Oswald BuddenhagenNext: Junio C Hamano
Message 8 of 10 in “Is there a way to get the "format-patch" formatted file name?”
  1. Vít OndruchAug 31, 2023
  2. Oswald BuddenhagenAug 31, 2023
  3. Vít OndruchAug 31, 2023
  4. Oswald BuddenhagenAug 31, 2023
  5. Junio C HamanoAug 31, 2023
  6. Vít OndruchSep 1, 2023
  7. Oswald BuddenhagenSep 1, 2023
  8. Junio C HamanoSep 1, 2023
  9. Junio C HamanoSep 1, 2023
  10. Vít OndruchSep 1, 2023

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.