Hacker News new | ask | show | jobs
by Sesse__ 698 days ago
By default, it seems git-send-email adds the in-body From: with the committer. (I don't know if git am picks this up, but I suppose it does.) If I add --from _after_ $oldsha..$newsha, it seems that's the git-format-patch --from, which _also_ adds something based on the headers sent by git-http-backend, so I get two From: in the body, where the first is:

From: anonymous <anonymous@http.2001:<…my IP address here…>>

I guess what I really want is Reply-To: being set based on the commit message, but I don't know if git can do that easily.

1 comments

Ah interesting. I use git-format-patch instead of git-send-email myself, so I can re-read the resulting mbox before sending it. I always thought of git-send-email as a wrapper that just passed most options straight through to format-patch, but sounds like it does something more with --from.

I haven't read builtin/log.c (edit: and pretty.c) to check how risky the From: field actually is. It might be that it is guaranteed to be properly/safely quoted by git - but it might not be too! When I embedded a " in the author name by hand, the From: line was correctly quoted as

  From: "first\"last" <email@email>
but that's no guarantee that it's done for every malicious author/committer without inspecting the code.