Using --from with git-format-patch will add the From: header to the commit message body in the standard way when emailing a patch written by someone else, which would allow you to preserve this easily without risking excitement from injection attacks into email headers.
Maybe the right behaviour for all-zero $oldsha is to quietly turn format-patch $oldsha..$newsha into format-patch --root $newsha?
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.
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. echo 'The push will now exit with an error. No commits have actually been pushed.'
Is this part so that the temporary git objects are cleaned up? Or is there some other reason that it has to exit with error?One could in theory use git namespaces to keep the new branches but not make them overwrite existing ones, but then people could store porn or whatever for free on your server and have it be served to others.
(I wrote the blog post)
> keep the new branches but not make them overwrite existing ones, but then people could store porn or whatever for free on your server and have it be served to others
When your program sends the mail, do you use any external services for that (GMail, etc) or do you run a local SMTP server? How about the receiving address, is that one self-hosted or powered by a third-party?