{"thread":{"id":"23546","subject":"I need a `git format-patch --attach-complete' for RT","startedAt":"2010-04-21T12:22:24Z","lastAt":"2010-04-29T10:16:30Z","messageCount":3,"participants":["Ævar Arnfjörð Bjarmason","Paolo Bonzini"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"140025","messageId":"q2j51dd1af81004210522ze6062110j2033788601e17ce8@mail.gmail.com","threadId":"23546","inReplyTo":null,"subject":"I need a `git format-patch --attach-complete' for RT","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-04-21T12:22:24Z","receivedAt":"2010-04-21T12:22:24Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"I'm working with a system that doesn't play nice with git-format-patch\n/ git-send-email. When you send mail to RT (e.g. http://rt.perl.org/)\nit'll always munge the original E-Mail, so inline patches won't\nwork. Here's an example of this gone wrong:\n\n    commit f9bcfeacc119e37fd70816a2cb4678fded53e8d1\n    Author: Ãvar ArnfjÃ¶rÃ° Bjarmason) (via RT <perlbug-followup@perl.org>\n    Date:   Tue Apr 20 10:58:37 2010 -0700\n\n        GitHub's mirror is now at mirrors/perl, not github/perl\n\n        # New Ticket Created by  (Ævar Arnfjörð Bjarmason)\n        # Please include the string:  [perl #74532]\n        # in the subject line of all future correspondence about this issue.\n        # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=74532 >\n        From: Ævar Arnfjörð Bjarmason <avar@cpan.org>\n\nThe workaround is to:\n\n    git format-patch --stdout origin.. > my-patches.patch\n    *open your mail client*\n    *attach patch as attachment*\n    *send to RT*\n\nIt would be nicer if I could instead:\n\n    git format-patch --attach-complete origin..\n    git send-email *.patch\n\nThe --attach option doesn't work with RT because `git am' will take\nthe commit message from the Subject/body of the message. RT messes\nwith that.\n\nIs there some existing workaround for this that I've missed?\n"},{"id":"140657","messageId":"4BD93465.60507@gnu.org","threadId":"23546","inReplyTo":"q2j51dd1af81004210522ze6062110j2033788601e17ce8@mail.gmail.com","subject":"Re: I need a `git format-patch --attach-complete' for RT","fromName":"Paolo Bonzini","fromEmail":"bonzini@gnu.org","sentAt":"2010-04-29T07:25:25Z","receivedAt":"2010-04-29T07:25:25Z","isPatch":false,"sender":{"key":"bonzini@gnu.org","avatar":"https://avatars.githubusercontent.com/u/42082?v=4"},"body":"On 04/21/2010 02:22 PM, Ævar Arnfjörð Bjarmason wrote:\n> I'm working with a system that doesn't play nice with git-format-patch\n> / git-send-email. When you send mail to RT (e.g. http://rt.perl.org/)\n> it'll always munge the original E-Mail, so inline patches won't\n> work. [...]It would be nicer if I could instead:\n>\n>      git format-patch --attach-complete origin..\n>      git send-email *.patch\n\nThis is a bit underspecified.  What should the subject be?  Do you want \nto have something like --cover-letter but placing the messages after \n00/NN in an attachment?\n\nIt seems easiest to write a small filter in Perl, but it could be added \nas an option to git-format-patch, maybe something like \n--cover-letter=attach-all.\n\nPaolo\n"},{"id":"140634","messageId":"u2v51dd1af81004290316ieb90661ex209a73910cfccb75@mail.gmail.com","threadId":"23546","inReplyTo":"4BD93465.60507@gnu.org","subject":"Re: I need a `git format-patch --attach-complete' for RT","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-04-29T10:16:30Z","receivedAt":"2010-04-29T10:16:30Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Thu, Apr 29, 2010 at 07:25, Paolo Bonzini <bonzini@gnu.org> wrote:\n> On 04/21/2010 02:22 PM, Ævar Arnfjörð Bjarmason wrote:\n>>\n>> I'm working with a system that doesn't play nice with git-format-patch\n>> / git-send-email. When you send mail to RT (e.g. http://rt.perl.org/)\n>> it'll always munge the original E-Mail, so inline patches won't\n>> work. [...]It would be nicer if I could instead:\n>>\n>>     git format-patch --attach-complete origin..\n>>     git send-email *.patch\n>\n> This is a bit underspecified.  What should the subject be?  Do you want to\n> have something like --cover-letter but placing the messages after 00/NN in\n> an attachment?\n\nIt should work exactly as if though you'd taken the *.patch file\ngenerated by `git format-patch a..b` and attached it as a MIME\nattachment in your mailer.\n\nThe subject of the E-Mail itself should be the same\n\nI want it to work exactly like `git format-patch` does, except it\nshould attach the patch as a multipart MIME part. The content of the\nmessage itself (a text/plain MIME part) should be the same as now,\nexcept it should skip the actual patch.\n\nHere's an example of how it should look, generated by GMail:\n\n    MIME-Version: 1.0\n    Date: Thu, 29 Apr 2010 10:00:18 +0000\n    Subject: [PATCH] Don't ask the porters to fetch commits from a private URL\n    From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= <avar@cpan.org>\n    Content-Type: multipart/mixed; boundary=00163649a453b0a1ef04855d3190\n\n    --00163649a453b0a1ef04855d3190\n    Content-Type: text/plain; charset=UTF-8\n\n    git@github.com:USERNAME/perl.git is only accessible to USERNAME (or\n    collaborators), git://github.com/USERNAME/perl.git is available to\n    everyone.\n    ---\n    See the attached patch for the changes described in the diffstat below.\n\n     pod/perlrepository.pod |    2 +-\n     1 files changed, 1 insertions(+), 1 deletions(-)\n\n    --00163649a453b0a1ef04855d3190\n    Content-Type: text/x-patch; charset=US-ASCII;\n    name=\"0001-Don-t-ask-the-porters-to-fetch-commits-from-a-privat.patch\"\n    Content-Disposition: attachment;\n    filename=\"0001-Don-t-ask-the-porters-to-fetch-commits-from-a-privat.patch\"\n    Content-Transfer-Encoding: base64\n    X-Attachment-Id: f_g8lej0oz0\n\n    RnJvbSBmYjYwZTc0NWZkYWI2YzNkZjNkMjU0YjRjMmE2OTM5MzA3ZDNmOGE3IE1vbiBTZXAgMTcg\n    MDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/PUMzPTg2dmFyPTIwQXJuZmo9QzM9QjZyPUMz\n    PUIwPTIwQmphcm1hc29uPz0gPGF2YXJAY3Bhbi5vcmc+CkRhdGU6IFR1ZSwgMjAgQXByIDIwMTAg\n    MTk6Mjg6MDEgKzAwMDAKU3Viam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EgR2l0SHViCiAKLS0gCjEu\n    Ny4xLnJjMQoK\n    --00163649a453b0a1ef04855d3190--\n\nFor comparison this is what `git format-patch a..b` will give me now:\n\n    From fb60e745fdab6c3df3d254b4c2a6939307d3f8a7 Mon Sep 17 00:00:00 2001\n    From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= <avar@cpan.org>\n    Date: Tue, 20 Apr 2010 19:28:01 +0000\n    Subject: [PATCH] Don't ask the porters to fetch commits from a private URL\n\n    git@github.com:USERNAME/perl.git is only accessible to USERNAME (or\n    collaborators), git://github.com/USERNAME/perl.git is available to\n    everyone.\n    ---\n     pod/perlrepository.pod |    2 +-\n     1 files changed, 1 insertions(+), 1 deletions(-)\n\n    diff --git a/pod/perlrepository.pod b/pod/perlrepository.pod\n    index 00dbbfa..cc87bde 100644\n    --- a/pod/perlrepository.pod\n    +++ b/pod/perlrepository.pod\n    @@ -757,7 +757,7 @@ email (see L</SUBMITTING A PATCH>) with a\ndescription of your changes\n     and the following information:\n\n       http://github.com/USERNAME/perl/tree/orange\n    -  git@github.com:USERNAME/perl.git branch orange\n    +  git://github.com/USERNAME/perl.git branch orange\n\n     =head1 Merging from a branch via GitHub\n\n    --\n    1.7.1.rc1\n\nAnd this is what `git format-patch --attach a..b` gives you. It just\nattaches the patch (`git diff`). Not its commit message:\n\n    From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= <avar@cpan.org>\n    Date: Tue, 20 Apr 2010 19:28:01 +0000\n    Subject: [PATCH] Don't ask the porters to fetch commits from a private URL\n    Date: Wed, 21 Apr 2010 11:48:19 +0000\n    MIME-Version: 1.0\n    Content-Type: multipart/mixed; boundary=\"------------1.7.1.rc1\"\n\n    From: Ævar Arnfjörð Bjarmason <avar@cpan.org>\n\n    This is a multi-part message in MIME format.\n    --------------1.7.1.rc1\n    Content-Type: text/plain; charset=UTF-8; format=fixed\n    Content-Transfer-Encoding: 8bit\n\n\n    git@github.com:USERNAME/perl.git is only accessible to USERNAME (or\n    collaborators), git://github.com/USERNAME/perl.git is available to\n    everyone.\n    ---\n     pod/perlrepository.pod |    2 +-\n     1 files changed, 1 insertions(+), 1 deletions(-)\n\n\n    --------------1.7.1.rc1\n    Content-Type: text/x-patch;\nname=\"0001-Don-t-ask-the-porters-to-fetch-commits-from-a-privat.patch\"\n    Content-Transfer-Encoding: 8bit\n    Content-Disposition: attachment;\nfilename=\"0001-Don-t-ask-the-porters-to-fetch-commits-from-a-privat.patch\"\n\n    diff --git a/pod/perlrepository.pod b/pod/perlrepository.pod\n    index 7dd4c25..15809dc 100644\n    --- a/pod/perlrepository.pod\n    +++ b/pod/perlrepository.pod\n    @@ -757,7 +757,7 @@ email (see L</SUBMITTING A PATCH>) with a\ndescription of your changes\n     and the following information:\n\n       http://github.com/USERNAME/perl/tree/orange\n    -  git@github.com:USERNAME/perl.git branch orange\n    +  git://github.com/USERNAME/perl.git branch orange\n\n     =head1 Merging from a branch via GitHub\n\n\n    --------------1.7.1.rc1--\n\n> It seems easiest to write a small filter in Perl, but it could be added as\n> an option to git-format-patch, maybe something like\n> --cover-letter=attach-all.\n\nYeah it'd be easiest to write one in Perl, but it would have to be in\ncore so you could tell random contributors to send patches with the\nbuilt-in tools using the new option easily.\n\nThe relevant bits in builtin/log.c are scary :) With other projects I\ndon't think I'll be patching it myself very soon (if ever). But I'd be\nvery thankful if someone would code this up.\n\nIt would be very useful for projects with silly Email-to-Bugtracker\ngateways. A lot of silly E-Mail system will destroy inline content,\nbut they generally leave MIME attachments alone.\n"}]}