Hacker News new | ask | show | jobs
by webdevver 979 days ago
I wish I could "preview" sending my patch to mailing lists. I've considered the idea of having a localhost mailing list for the sole purpose of sending it there just to make sure that i've got everything setup right, but haven't gotten around to doing it yet.
3 comments

    git send-email --dry-run <commitish>
will show you the mail headers it would have generated (including subject lines, To: and Cc: fields).

    git format-patch -o<tempdir> <committish>
will create a separate mail-like file for each patch in <tempdir>. Finally,

    git format-patch --stdout <committish> > foo.mbox
will (I think) generate something which something capable of reading mbox'es should be able to read. (The latter I may be remembering incorrectly, but worth giving a try.)
If you just want to preview the patch itself you can generate it and preview/test use it by doing "git diff > my-own-patch.patch", which would be identical to the patch that "git send-email" would attach to your email. You can apply it with "git apply my-own-patch.patch" for example.

People generally are helpful if it's your first time contributing, so if someone isn't right, I'm sure someone will help you get it right.

I've found a way to "preview" emails without too much preparatory hassle, at least on Gmail that allows adding suffixes to your address after a + sign. After you finish writing the email, rewrite all the addresses in the To: and Cc: lines so instead of pointing to foo@example.com, they point to myaddress+foo+example.com@gmail.com. Then, once you send it, you can check the version in your inbox to make sure everything is correct, and undo the rewrite to send the email for real.