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

Re: Diffs "from" working directory

From
Linus Torvalds <torvalds@osdl.org>
Date
Nov 22, 2005, 18:32 UTC
Message-ID
<Pine.LNX.4.64.0511221025580.13959@g5.osdl.org>
In-Reply-To
<43835D8E.60109@citi.umich.edu>
On Tue, 22 Nov 2005, Chuck Lever wrote:
Show 9 quoted lines
> 
> then perhaps the problem is that the "stg mail" tool should place the author
> in the From: field automatically?  (ie change the tool, or permanently modify
> the default template that comes with StGIT to do this, as Catalin suggested
> earlier).
> 
> that seems a little twisty to me; you're overloading the SMTP header field
> instead of explicitly specifying patch authorship.  seems like a layering
> violation.

No, I only use the actual SMTP header field if the _body_ of the email doesn't contain the "From:".

So there's really two different "From:" lines: there's the SMTP header one, which is just a default fallback one, and there's the first non-empty line of the email body itself, which is the preferred one. No layering violation, just two different layers that have the same format for the line.

See "The Perfect Patch" by Andrew, and bullet (4): Attribution:
	http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt
To quote:
   'If someone else wrote the patch, they should be credited (and blamed) 
    for it. To communicate this, add a line:
    From: John Doe <jdoe@wherever.com>
    as the very first line of the email.  Downstream tools will pick this 
    up and jdoe will get the git "Author" line.'

and I'd be even more anal about it: I would seriously suggest to people that they just _always_ add the "From:" line at the head of the email, even if it just is exactly the same as what will be in the SMTP header.

Why? Simple. It makes is less likely that somebody who just forwards the patch will forget to add that line for you. So you are really helping people out - and making sure the attribution stays correct - by adding that extra "From:" line at the top of your email body, even if it is "unnecessary" in the sense that it's also in your SMTP header.

		Linus
Previous: Chuck LeverNext: Catalin Marinas
Message 11 of 12 in “Re: Diffs "from" working directory”
  1. J. Bruce FieldsNov 20, 2005
  2. Linus TorvaldsNov 20, 2005
  3. J. Bruce FieldsNov 20, 2005
  4. Chuck LeverNov 21, 2005
  5. Catalin MarinasNov 21, 2005
  6. Junio C HamanoNov 21, 2005
  7. Catalin MarinasNov 21, 2005
  8. Chuck LeverNov 22, 2005
  9. Linus TorvaldsNov 22, 2005
  10. Chuck LeverNov 22, 2005
  11. Linus TorvaldsNov 22, 2005
  12. Catalin MarinasNov 22, 2005

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.