It should work exactly as if though you'd taken the *.patch file generated by `git format-patch a..b` and attached it as a MIME attachment in your mailer.
The subject of the E-Mail itself should be the same
I want it to work exactly like `git format-patch` does, except it should attach the patch as a multipart MIME part. The content of the message itself (a text/plain MIME part) should be the same as now, except it should skip the actual patch.
Here's an example of how it should look, generated by GMail:
MIME-Version: 1.0
Date: Thu, 29 Apr 2010 10:00:18 +0000
Subject: [PATCH] Don't ask the porters to fetch commits from a private URL
From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= <avar@cpan.org>
Content-Type: multipart/mixed; boundary=00163649a453b0a1ef04855d3190 --00163649a453b0a1ef04855d3190
Content-Type: text/plain; charset=UTF-8 git@github.com:USERNAME/perl.git is only accessible to USERNAME (or
collaborators), git://github.com/USERNAME/perl.git is available to
everyone.
---
See the attached patch for the changes described in the diffstat below. pod/perlrepository.pod | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-) --00163649a453b0a1ef04855d3190
Content-Type: text/x-patch; charset=US-ASCII;
name="0001-Don-t-ask-the-porters-to-fetch-commits-from-a-privat.patch"
Content-Disposition: attachment;
filename="0001-Don-t-ask-the-porters-to-fetch-commits-from-a-privat.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_g8lej0oz0 RnJvbSBmYjYwZTc0NWZkYWI2YzNkZjNkMjU0YjRjMmE2OTM5MzA3ZDNmOGE3IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/PUMzPTg2dmFyPTIwQXJuZmo9QzM9QjZyPUMz
PUIwPTIwQmphcm1hc29uPz0gPGF2YXJAY3Bhbi5vcmc+CkRhdGU6IFR1ZSwgMjAgQXByIDIwMTAg
MTk6Mjg6MDEgKzAwMDAKU3ViamVjdDogW1BBVENIXSBEb24ndCBhc2sgdGhlIHBvcnRlcnMgdG8g
ZmV0Y2ggY29tbWl0cyBmcm9tIGEgcHJpdmF0ZSBVUkwKCmdpdEBnaXRodWIuY29tOlVTRVJOQU1F
L3BlcmwuZ2l0IGlzIG9ubHkgYWNjZXNzaWJsZSB0byBVU0VSTkFNRSAob3IKY29sbGFib3JhdG9y
cyksIGdpdDovL2dpdGh1Yi5jb20vVVNFUk5BTUUvcGVybC5naXQgaXMgYXZhaWxhYmxlIHRvCmV2
ZXJ5b25lLgotLS0KIHBvZC9wZXJscmVwb3NpdG9yeS5wb2QgfCAgICAyICstCiAxIGZpbGVzIGNo
YW5nZWQsIDEgaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9wb2Qv
cGVybHJlcG9zaXRvcnkucG9kIGIvcG9kL3BlcmxyZXBvc2l0b3J5LnBvZAppbmRleCAwMGRiYmZh
Li5jYzg3YmRlIDEwMDY0NAotLS0gYS9wb2QvcGVybHJlcG9zaXRvcnkucG9kCisrKyBiL3BvZC9w
ZXJscmVwb3NpdG9yeS5wb2QKQEAgLTc1Nyw3ICs3NTcsNyBAQCBlbWFpbCAoc2VlIEw8L1NVQk1J
VFRJTkcgQSBQQVRDSD4pIHdpdGggYSBkZXNjcmlwdGlvbiBvZiB5b3VyIGNoYW5nZXMKIGFuZCB0
aGUgZm9sbG93aW5nIGluZm9ybWF0aW9uOgogCiAgIGh0dHA6Ly9naXRodWIuY29tL1VTRVJOQU1F
L3BlcmwvdHJlZS9vcmFuZ2UKLSAgZ2l0QGdpdGh1Yi5jb206VVNFUk5BTUUvcGVybC5naXQgYnJh
bmNoIG9yYW5nZQorICBnaXQ6Ly9naXRodWIuY29tL1VTRVJOQU1FL3BlcmwuZ2l0IGJyYW5jaCBv
cmFuZ2UKIAogPWhlYWQxIE1lcmdpbmcgZnJvbSBhIGJyYW5jaCB2aWEgR2l0SHViCiAKLS0gCjEu
Ny4xLnJjMQoK
--00163649a453b0a1ef04855d3190--For comparison this is what `git format-patch a..b` will give me now:
From fb60e745fdab6c3df3d254b4c2a6939307d3f8a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= <avar@cpan.org>
Date: Tue, 20 Apr 2010 19:28:01 +0000
Subject: [PATCH] Don't ask the porters to fetch commits from a private URL git@github.com:USERNAME/perl.git is only accessible to USERNAME (or
collaborators), git://github.com/USERNAME/perl.git is available to
everyone.
---
pod/perlrepository.pod | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/pod/perlrepository.pod b/pod/perlrepository.pod
index 00dbbfa..cc87bde 100644
--- a/pod/perlrepository.pod
+++ b/pod/perlrepository.pod
@@ -757,7 +757,7 @@ email (see L</SUBMITTING A PATCH>) with a
description of your changes
and the following information: http://github.com/USERNAME/perl/tree/orange
- git@github.com:USERNAME/perl.git branch orange
+ git://github.com/USERNAME/perl.git branch orange =head1 Merging from a branch via GitHub
--
1.7.1.rc1And this is what `git format-patch --attach a..b` gives you. It just attaches the patch (`git diff`). Not its commit message:
From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= <avar@cpan.org>
Date: Tue, 20 Apr 2010 19:28:01 +0000
Subject: [PATCH] Don't ask the porters to fetch commits from a private URL
Date: Wed, 21 Apr 2010 11:48:19 +0000
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------1.7.1.rc1" From: Ævar Arnfjörð Bjarmason <avar@cpan.org>
This is a multi-part message in MIME format.
--------------1.7.1.rc1
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit git@github.com:USERNAME/perl.git is only accessible to USERNAME (or
collaborators), git://github.com/USERNAME/perl.git is available to
everyone.
---
pod/perlrepository.pod | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-) --------------1.7.1.rc1
Content-Type: text/x-patch;
name="0001-Don-t-ask-the-porters-to-fetch-commits-from-a-privat.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
filename="0001-Don-t-ask-the-porters-to-fetch-commits-from-a-privat.patch" diff --git a/pod/perlrepository.pod b/pod/perlrepository.pod
index 7dd4c25..15809dc 100644
--- a/pod/perlrepository.pod
+++ b/pod/perlrepository.pod
@@ -757,7 +757,7 @@ email (see L</SUBMITTING A PATCH>) with a
description of your changes
and the following information: http://github.com/USERNAME/perl/tree/orange
- git@github.com:USERNAME/perl.git branch orange
+ git://github.com/USERNAME/perl.git branch orange =head1 Merging from a branch via GitHub
--------------1.7.1.rc1--