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

Re: [RFC] format-patch: Ensure that author and commit time are not lost

From
Jeff King <peff@peff.net>
Date
Nov 16, 2009, 05:20 UTC
Message-ID
<20091116052041.GD14664@coredump.intra.peff.net>
In-Reply-To
<7vzl6nfqkx.fsf@alter.siamese.dyndns.org>
On Sun, Nov 15, 2009 at 01:03:42PM -0800, Junio C Hamano wrote:
> I would expect the right solution would be to give send-email an ability
> to either (1) use "Sender:" to record the operator of the MUA while
> keeping "From: " taken from the payload, or (2) duplicate "From: " as an
> in-body header when it sends out.

I agree that send-email is the "right" place for this functionality in the git toolchain. And indeed, it already does (2):

  $ sed -ne '/$author ne $sender/,+1p' git-send-email.perl
          if (defined $author and $author ne $sender) {
                          $message = "From: $author\n\n$message";

That being said, like you, I usually pull the patches directly from format-patch into my MUA, and I fix up the headers manually. I suspect there are many others who do the same thing. And each of us has to either handle this case manually, or write our own munging code ourselves for our particular setup.

So in that sense, even though format-patch is not the right place, it may be useful for it to give tool support to people who do not use the "format-patch to send-email" workflow. In other words, I would be happy if my short glue shell-script became:

  git format-patch --stdout --sender-is-me "$@" >mbox &&
  mutt -f mbox

and this just handled the case properly, without me having to parse the From header of each message and munge the messages in my script.

The arguments against it are:
  1. It is polluting format-patch with MUA cruft.
  2. --sender-is-me (besides being a terrible name) may not be
     expressive enough. You might want --sender=... depending on the
     setup of the calling script.

Honestly, though, I send few enough patches made by other people that I have never found it to be a huge burden. This would be a minor convenience to have.

-Peff
Previous: Björn Gustavsson
Message 4 of 4 in “[RFC] format-patch: Ensure that author and commit time are not lost”
  1. Björn GustavssonNov 15, 2009
  2. Junio C HamanoNov 15, 2009
  3. Björn GustavssonNov 15, 2009
  4. Jeff KingNov 16, 2009

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.