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

[RFC] git-format-patch: default to --from to avoid spoofed mails?

From
Josh Triplett <josh@joshtriplett.org>
Date
Jul 28, 2016, 21:11 UTC
Message-ID
<20160728211149.GA371@x>

When git-format-patch formats a patch authored by someone other than yourself, it defaults to filling in the "From:" field of the email from the commit author. If you explicitly pass the --from option, git-format-patch will instead use your own committer identity as the "From:", and then put a "From:" line at the top of the body if the commit author differs. (git-am know to use that as the commit author when applying.)

While git-send-email knows how to change the patch mails to use your own address as "From:" and add a "From:" line to the body for the author, any other tool used to send emails doesn't do that. I've seen more than a few mails sent to various mailing lists and patch review tools with a spoofed "From:" field pointing to the commit author, typically without the knowledge of the author, which can lead to interesting surprises.

I'd like to propose changing the default behavior of git-format-patch to --from (and adding a --from-author option to override, and perhaps a config setting). This will not change the output *except* when formatting patches authored by someone else. git-am and git-send-email both handle the --from format without any issues.

Before I write such a patch: does anyone see a problem with such a change?

- Josh Triplett
Next: Junio C Hamano
Message 1 of 19 in “[RFC] git-format-patch: default to --from to avoid spoofed mails?”
  1. Josh TriplettJul 28, 2016
  2. Junio C HamanoJul 28, 2016
  3. Jeff KingJul 28, 2016
  4. Junio C HamanoJul 28, 2016
  5. Josh TriplettJul 28, 2016
  6. Jeff KingJul 29, 2016
  7. Jeff KingJul 29, 2016
  8. Josh TriplettJul 29, 2016
  9. Jeff KingJul 29, 2016
  10. Josh TriplettJul 30, 2016
  11. Jeff KingJul 30, 2016
  12. Josh TriplettJul 30, 2016
  13. 0/2 format-patch: Transition the default to --from to avoid spoofed mailsJosh Triplett, Jul 30, 2016
  14. Junio C HamanoAug 1, 2016
  15. Jeff KingAug 1, 2016
  16. Junio C HamanoAug 1, 2016
  17. Josh TriplettJul 29, 2016
  18. Josh TriplettJul 29, 2016
  19. Junio C HamanoJul 29, 2016

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.