{"thread":{"id":"14393","subject":"[PATCH] Added --export option to git-send-email.","startedAt":"2008-07-10T14:07:35Z","lastAt":"2008-07-14T03:41:02Z","messageCount":15,"participants":["Eduard - Gabriel Munteanu","Junio C Hamano","Avery Pennarun"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"82812","messageId":"20080710170735.4c5b237a@linux360.ro","threadId":"14393","inReplyTo":null,"subject":"[PATCH] Added --export option to git-send-email.","fromName":"Eduard - Gabriel Munteanu","fromEmail":"eduard.munteanu@linux360.ro","sentAt":"2008-07-10T14:07:35Z","receivedAt":"2008-07-10T14:07:35Z","isPatch":true,"sender":{"key":"eduard.munteanu@linux360.ro","avatar":null},"body":"This option allows the user to process patches with git-send-email and then\nimport them into an email client, without having to send them directly. The\noutput format is mbox.\n\nSigned-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>\n---\n Documentation/git-send-email.txt |    6 ++++++\n git-send-email.perl              |   19 +++++++++++++++++++\n 2 files changed, 25 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex afbb294..17a59dd 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -73,6 +73,12 @@ The --cc option must be repeated for each user you want on the cc list.\n         Default is the value of 'sendemail.signedoffcc' configuration value;\n         if that is unspecified, default to --signed-off-by-cc.\n \n+--export::\n+\tDo not send anything, just export the emails in mbox format. You can\n+\tuse this if you need to import the messages into your email client,\n+\tfor example. Overwrites the target, which must not be one of the\n+\tinput files.\n+\n --quiet::\n \tMake git-send-email less verbose.  One line per email should be\n \tall that is output.\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 3564419..53539cf 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -100,6 +100,9 @@ Options:\n    --thread       Specify that the \"In-Reply-To:\" header should be set on all\n                   emails. Defaults to on.\n \n+   --export\t  Don't actually send emails, just export them to a mbox file.\n+\t\t  Overwrites target, which must not be one of the input files.\n+\n    --quiet\t  Make git-send-email less verbose.  One line per email\n                   should be all that is output.\n \n@@ -184,6 +187,7 @@ if ($@) {\n \n # Behavior modification variables\n my ($quiet, $dry_run) = (0, 0);\n+my ($export_file);\n \n # Variables with corresponding config settings\n my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc, $cc_cmd);\n@@ -260,6 +264,7 @@ my $rc = GetOptions(\"sender|from=s\" => \\$sender,\n \t\t    \"suppress-from!\" => \\$suppress_from,\n \t\t    \"suppress-cc=s\" => \\@suppress_cc,\n \t\t    \"signed-off-cc|signed-off-by-cc!\" => \\$signed_off_cc,\n+\t\t    \"export=s\" => \\$export_file,\n \t\t    \"dry-run\" => \\$dry_run,\n \t\t    \"envelope-sender=s\" => \\$envelope_sender,\n \t\t    \"thread!\" => \\$thread,\n@@ -691,6 +696,7 @@ sub sanitize_address\n \n }\n \n+my ($out);\n sub send_message\n {\n \tmy @recipients = unique_email_list(@to);\n@@ -741,6 +747,10 @@ X-Mailer: git-send-email $gitversion\n \n \tif ($dry_run) {\n \t\t# We don't want to send the email.\n+\t} elsif (defined $export_file) {\n+\t\tmy $mbox_from = \"From $raw_from $date\";\n+\t\t$message =~ s/^(>{0,})From/>$1From/m;\n+\t\tprint $out \"$mbox_from\\n$header\\n$message\";\n \t} elsif ($smtp_server =~ m#^/#) {\n \t\tmy $pid = open my $sm, '|-';\n \t\tdefined $pid or die $!;\n@@ -835,6 +845,11 @@ $reply_to = $initial_reply_to;\n $references = $initial_reply_to || '';\n $subject = $initial_subject;\n \n+if (defined $export_file) {\n+\tmy $err = open $out, '>', $export_file;\n+\tdefined $err or die \"Can't open '$export_file': $!\";\n+}\n+\n foreach my $t (@files) {\n \topen(F,\"<\",$t) or die \"can't open file $t\";\n \n@@ -979,6 +994,10 @@ foreach my $t (@files) {\n \t$message_id = undef;\n }\n \n+if (defined $export_file) {\n+\tclose $out or warn $?;\n+}\n+\n if ($compose) {\n \tcleanup_compose_files();\n }\n-- \n1.5.6.1\n"},{"id":"82925","messageId":"7vskugkimt.fsf@gitster.siamese.dyndns.org","threadId":"14393","inReplyTo":"20080710170735.4c5b237a@linux360.ro","subject":"Re: [PATCH] Added --export option to git-send-email.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-11T07:03:06Z","receivedAt":"2008-07-11T07:03:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> writes:\n\n> This option allows the user to process patches with git-send-email and then\n> import them into an email client, without having to send them directly. The\n> output format is mbox.\n\nInput format is also mbox, so an obvious question is \"why?\"\n"},{"id":"83002","messageId":"20080711225314.4ac268bf@linux360.ro","threadId":"14393","inReplyTo":"7vskugkimt.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Added --export option to git-send-email.","fromName":"Eduard - Gabriel Munteanu","fromEmail":"eduard.munteanu@linux360.ro","sentAt":"2008-07-11T19:53:14Z","receivedAt":"2008-07-11T19:53:14Z","isPatch":true,"sender":{"key":"eduard.munteanu@linux360.ro","avatar":null},"body":"On Fri, 11 Jul 2008 00:03:06 -0700\nJunio C Hamano <gitster@pobox.com> wrote:\n\n> Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> writes:\n> \n> > This option allows the user to process patches with git-send-email\n> > and then import them into an email client, without having to send\n> > them directly. The output format is mbox.\n> \n> Input format is also mbox, so an obvious question is \"why?\"\n\nHi,\n\ngit-send-email has a lot more mail processing power than\ngit-format-patch. For example, there is no way to fill in \"To:\" with\ngit-format-patch.\n\nI use this because I want to send the emails with my mail client\n(Claws-Mail), not directly. This allows me to use git-send-email to\nprocess patches instead of kludging the headers with something like\nformail.\n\n\n\tEduard\n"},{"id":"83166","messageId":"7vskudr11m.fsf@gitster.siamese.dyndns.org","threadId":"14393","inReplyTo":"20080710170735.4c5b237a@linux360.ro","subject":"Re: [PATCH] Added --export option to git-send-email.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-13T20:17:57Z","receivedAt":"2008-07-13T20:17:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> writes:\n\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index 3564419..53539cf 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -741,6 +747,10 @@ X-Mailer: git-send-email $gitversion\n>  \n>  \tif ($dry_run) {\n>  \t\t# We don't want to send the email.\n> +\t} elsif (defined $export_file) {\n> +\t\tmy $mbox_from = \"From $raw_from $date\";\n> +\t\t$message =~ s/^(>{0,})From/>$1From/m;\n> +\t\tprint $out \"$mbox_from\\n$header\\n$message\";\n\nSorry, but I am scratching my head here.  Shouldn't this \"bare From\nmunging\" be like this instead?\n\n\t\t$message =~ s/^From />From /m;\n"},{"id":"83178","messageId":"32541b130807131432j78e5100dyea20893268321466@mail.gmail.com","threadId":"14393","inReplyTo":"7vskudr11m.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Added --export option to git-send-email.","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-07-13T21:32:57Z","receivedAt":"2008-07-13T21:32:57Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On 7/13/08, Junio C Hamano <gitster@pobox.com> wrote:\n> Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> writes:\n>  > +     } elsif (defined $export_file) {\n>  > +             my $mbox_from = \"From $raw_from $date\";\n>  > +             $message =~ s/^(>{0,})From/>$1From/m;\n>  > +             print $out \"$mbox_from\\n$header\\n$message\";\n>\n> Sorry, but I am scratching my head here.  Shouldn't this \"bare From\n>  munging\" be like this instead?\n>\n>                 $message =~ s/^From />From /m;\n\nThat wouldn't be a reversible operation.\n\nHave fun,\n\nAvery\n"},{"id":"83180","messageId":"7vbq11qxfb.fsf@gitster.siamese.dyndns.org","threadId":"14393","inReplyTo":"32541b130807131432j78e5100dyea20893268321466@mail.gmail.com","subject":"Re: [PATCH] Added --export option to git-send-email.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-13T21:36:08Z","receivedAt":"2008-07-13T21:36:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Avery Pennarun\" <apenwarr@gmail.com> writes:\n\n> On 7/13/08, Junio C Hamano <gitster@pobox.com> wrote:\n>> Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> writes:\n>>  > +     } elsif (defined $export_file) {\n>>  > +             my $mbox_from = \"From $raw_from $date\";\n>>  > +             $message =~ s/^(>{0,})From/>$1From/m;\n>>  > +             print $out \"$mbox_from\\n$header\\n$message\";\n>>\n>> Sorry, but I am scratching my head here.  Shouldn't this \"bare From\n>>  munging\" be like this instead?\n>>\n>>                 $message =~ s/^From />From /m;\n>\n> That wouldn't be a reversible operation.\n\nSo what?  Adding Cc: and stuff send-email does are already irreversible\nanyway.\n"},{"id":"83185","messageId":"32541b130807131444s5e9ea0d6v9610dd5871467fc9@mail.gmail.com","threadId":"14393","inReplyTo":"7vbq11qxfb.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Added --export option to git-send-email.","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-07-13T21:44:16Z","receivedAt":"2008-07-13T21:44:16Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On 7/13/08, Junio C Hamano <gitster@pobox.com> wrote:\n>  >> Sorry, but I am scratching my head here.  Shouldn't this \"bare From\n>  >>  munging\" be like this instead?\n>  >>\n>  >>                 $message =~ s/^From />From /m;\n>  >\n>  > That wouldn't be a reversible operation.\n>\n> So what?  Adding Cc: and stuff send-email does are already irreversible\n>  anyway.\n\nAt one point the people who write mailers realized that just munging\n\"From\" to \">From\" when putting things into an mbox was irreversible,\nie, there was no way to later display the contents of the mbox without\nshowing \">From\" where \"From\" was intended.\n\nHowever, if you always insert _another_ \">\" whenever \"^>*From\" is\ndetected, then you can also always do the opposite upon displaying to\nthe user, and the message is effectively not munged.  It becomes\nsimply a part of the mbox file encoding.\n\nSo by encoding it this way, someone with a modern mailer could view\nthe resulting mbox with all the munged text de-mungled.  Someone\nwithout a modern mailer would see munging anyhow, so they're no worse\noff.\n\nHave fun,\n\nAvery\n"},{"id":"83188","messageId":"7vvdz9o2wu.fsf@gitster.siamese.dyndns.org","threadId":"14393","inReplyTo":"32541b130807131444s5e9ea0d6v9610dd5871467fc9@mail.gmail.com","subject":"Re: [PATCH] Added --export option to git-send-email.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-13T22:05:53Z","receivedAt":"2008-07-13T22:05:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Avery Pennarun\" <apenwarr@gmail.com> writes:\n\n> So by encoding it this way, someone with a modern mailer could...\n\nHeh, so by that definition Gnus is not modern enough; neither is webmail\ninterface at gmail.\n\n>From which has originally zero level of >\n>From which has one\n>>From which has two\n>>>From which has three\n\nI am reasonably sure the above will be sent with one, one, two and three\ngt before \"From\".  Is your mailer modern enough?\n"},{"id":"83191","messageId":"32541b130807131521w79cbf23m5934678e68312798@mail.gmail.com","threadId":"14393","inReplyTo":"7vvdz9o2wu.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Added --export option to git-send-email.","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-07-13T22:21:05Z","receivedAt":"2008-07-13T22:21:05Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On 7/13/08, Junio C Hamano <gitster@pobox.com> wrote:\n> Heh, so by that definition Gnus is not modern enough; neither is webmail\n> interface at gmail.\n>\n>  From which has originally zero level of >\n>  >From which has one\n>  >>From which has two\n>  >>>From which has three\n>\n>  I am reasonably sure the above will be sent with one, one, two and three\n>  gt before \"From\".  Is your mailer modern enough?\n\nI read this message at gmail, and got zero, one, two, and three\ndashes, respectively.  For the sake of interest, I then connected to\ngmail using IMAP from mutt, and the message was still intact.  Then I\nsaved it to an mbox file using mutt, and it used Content-Length\ninstead of From munging, so it wasn't a very good experiment :)\n\nIf you're not actually delivering your mail using mbox format (as\nopposed to imap, webmail, etc), it would be quite insulting for \"From\n\" to be munged at all, so I'm happy at least that I didn't experience\nthat in my tests.  On the other hand I'm surprised that gmail should\nhave corrupted it for you; gmail should be able to completely forget\nabout the concept of \"From \" munging since they don't use mbox\ninternally.  (And it's the MDA's job to munge it, not the MTA, so the\nlines should never be munged while in transit *to* gmail unless the\nmailer app is extremely buggy.)\n\nHave fun,\n\nAvery\n"},{"id":"83192","messageId":"7vlk05o14i.fsf@gitster.siamese.dyndns.org","threadId":"14393","inReplyTo":"32541b130807131521w79cbf23m5934678e68312798@mail.gmail.com","subject":"Re: [PATCH] Added --export option to git-send-email.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-13T22:44:29Z","receivedAt":"2008-07-13T22:44:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Avery Pennarun\" <apenwarr@gmail.com> writes:\n\n> And it's the MDA's job to munge it, not the MTA, so the\n> lines should never be munged while in transit *to* ...\n\nYeah, you're right.  Sending side should not have any issues like that.\n\nMy receiving end (I think fetchmail slurps from my ISP and drops mails in\nmy local mbox, but it's a long time ago I configured my system...) does\nquote only the \"From \" at the beginning, which is consistent with the\ntraditional mbox behaviour, so I see one, one, two, three in my local\nmbox, and zero, one, two, three on gmane news article.\n\nIf this additional option claims to produce a mbox, I think:\n\n (1) quoting only /^From / (not /^>*From/) to be consistent with the\n     standard practice is the right thing to do; and\n\n (2) reading side might need to also pay attention to /^>From /, in case\n     somebody feeds an output from this option back to send-email.\n\nHowever, strictly speaking,(2) may break the standard workflow of\ngenerating patches with format-patch and feeding the result to send-email,\nas format-patch does not do /^From / munging (and it shouldn't).  The\nissue is mostly theoretical --- it only matters if your commit log has a\nline that begins with \">From \", and people who have worked with e-mail for\nany nontrivial period have already learned to reword their sentences to\navoid lines that begin with \"From \" (or \">From \", for that matter) anyway.\n"},{"id":"83196","messageId":"32541b130807131642k1382cf84gdf5e8bb8d2ff4ffe@mail.gmail.com","threadId":"14393","inReplyTo":"7vlk05o14i.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Added --export option to git-send-email.","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-07-13T23:42:35Z","receivedAt":"2008-07-13T23:42:35Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On 7/13/08, Junio C Hamano <gitster@pobox.com> wrote:\n>  If this additional option claims to produce a mbox, I think:\n>\n>   (1) quoting only /^From / (not /^>*From/) to be consistent with the\n>      standard practice is the right thing to do; and\n>\n>   (2) reading side might need to also pay attention to /^>From /, in case\n>      somebody feeds an output from this option back to send-email.\n>\n>  However, strictly speaking,(2) may break the standard workflow of\n>  generating patches with format-patch and feeding the result to send-email,\n>  as format-patch does not do /^From / munging (and it shouldn't).\n\nNote that it's generally very bad practice to do (2) unless you always\nquote /^>*From/.  Quoting only /^From/ and *then* trying to dequote it\ncorrectly actually increases the number of places where you can\ncorrupt a message.  As a sign that very few programs do (2), I think\nit's pretty clear that a lot more people see \"From\" rewritten as\n\">From\" in their mail app of choice than the reverse.\n\nThere is also some debate about what \"standard practice\" means.  See:\nhttp://homepages.tesco.net/J.deBoynePollard/FGA/mail-mbox-formats.html\n.\n\nIf git is going to start actually producing mbox files (as opposed to\njust individual messages as it does now), it should probably\nexplicitly take a stance on the issue... or perhaps make it\nconfigurable.\n\nHave fun,\n\nAvery\n"},{"id":"83198","messageId":"20080714025842.6630c47e@linux360.ro","threadId":"14393","inReplyTo":"32541b130807131642k1382cf84gdf5e8bb8d2ff4ffe@mail.gmail.com","subject":"Re: [PATCH] Added --export option to git-send-email.","fromName":"Eduard - Gabriel Munteanu","fromEmail":"eduard.munteanu@linux360.ro","sentAt":"2008-07-13T23:58:42Z","receivedAt":"2008-07-13T23:58:42Z","isPatch":true,"sender":{"key":"eduard.munteanu@linux360.ro","avatar":null},"body":"On Sun, 13 Jul 2008 19:42:35 -0400\n\"Avery Pennarun\" <apenwarr@gmail.com> wrote:\n\n> On 7/13/08, Junio C Hamano <gitster@pobox.com> wrote:\n> >  If this additional option claims to produce a mbox, I think:\n> >\n> >   (1) quoting only /^From / (not /^>*From/) to be consistent with\n> > the standard practice is the right thing to do; and\n> >\n> >   (2) reading side might need to also pay attention to /^>From /,\n> > in case somebody feeds an output from this option back to\n> > send-email.\n> >\n> >  However, strictly speaking,(2) may break the standard workflow of\n> >  generating patches with format-patch and feeding the result to\n> > send-email, as format-patch does not do /^From / munging (and it\n> > shouldn't).\n> \n> Note that it's generally very bad practice to do (2) unless you always\n> quote /^>*From/.  Quoting only /^From/ and *then* trying to dequote it\n> correctly actually increases the number of places where you can\n> corrupt a message.  As a sign that very few programs do (2), I think\n> it's pretty clear that a lot more people see \"From\" rewritten as\n> \">From\" in their mail app of choice than the reverse.\n\nJunio is right when he says we should match against \"From \" instead of\n\"From\" (i.e. we should not touch lines beginning with \"Fromage\" for\nexample). Should I resubmit or can it be corrected during the merge?\n \n> There is also some debate about what \"standard practice\" means.  See:\n> http://homepages.tesco.net/J.deBoynePollard/FGA/mail-mbox-formats.html\n> .\n\nWhen I started working on this, I visited Wikipedia which provided a\nlink to qmail's site, which looks quite authoritative on this matter:\nhttp://www.qmail.org/man/man5/mbox.html\n\nI just followed that spec.\n\n> If git is going to start actually producing mbox files (as opposed to\n> just individual messages as it does now), it should probably\n> explicitly take a stance on the issue... or perhaps make it\n> configurable.\n> \n> Have fun,\n> \n> Avery\n"},{"id":"83200","messageId":"20080714030534.70b91fd6@linux360.ro","threadId":"14393","inReplyTo":"7vlk05o14i.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Added --export option to git-send-email.","fromName":"Eduard - Gabriel Munteanu","fromEmail":"eduard.munteanu@linux360.ro","sentAt":"2008-07-14T00:05:34Z","receivedAt":"2008-07-14T00:05:34Z","isPatch":true,"sender":{"key":"eduard.munteanu@linux360.ro","avatar":null},"body":"On Sun, 13 Jul 2008 15:44:29 -0700\nJunio C Hamano <gitster@pobox.com> wrote:\n\n> However, strictly speaking,(2) may break the standard workflow of\n> generating patches with format-patch and feeding the result to\n> send-email, as format-patch does not do /^From / munging (and it\n> shouldn't).  The issue is mostly theoretical --- it only matters if\n> your commit log has a line that begins with \">From \", and people who\n> have worked with e-mail for any nontrivial period have already\n> learned to reword their sentences to avoid lines that begin with\n> \"From \" (or \">From \", for that matter) anyway.\n\nMunging happens only when doing --export. If you don't supply that\noption, it won't affect anything, so there is no breakage.\n\nBTW, git-format-patch already produces output somewhat compatible with\nmbox, as it adds a From_ line.\n\n\n\tEduard\n"},{"id":"83210","messageId":"7vtzetkviy.fsf@gitster.siamese.dyndns.org","threadId":"14393","inReplyTo":"32541b130807131642k1382cf84gdf5e8bb8d2ff4ffe@mail.gmail.com","subject":"Re: [PATCH] Added --export option to git-send-email.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-14T03:13:41Z","receivedAt":"2008-07-14T03:13:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Avery Pennarun\" <apenwarr@gmail.com> writes:\n\n> If git is going to start actually producing mbox files (as opposed to\n> just individual messages as it does now), it should probably\n> explicitly take a stance on the issue...\n\nYeah, that makes one reason I should not be enthusiastic to take this\npatch.\n"},{"id":"83211","messageId":"32541b130807132041jae15352mc605c37386309a3c@mail.gmail.com","threadId":"14393","inReplyTo":"7vtzetkviy.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Added --export option to git-send-email.","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-07-14T03:41:02Z","receivedAt":"2008-07-14T03:41:02Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On 7/13/08, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Avery Pennarun\" <apenwarr@gmail.com> writes:\n> > If git is going to start actually producing mbox files (as opposed to\n>  > just individual messages as it does now), it should probably\n>  > explicitly take a stance on the issue...\n>\n> Yeah, that makes one reason I should not be enthusiastic to take this\n>  patch.\n\nEduard: perhaps instead of a --export option, what about an option to\nrun an external program that will take the given email on stdin and\nprocess it however you want? ... aha, it seems this already exists in\nthe --smtp-server option.  So a shell script like this as your\n--smtp-server should do what you want:\n\n    #!/bin/sh\n    exec sed s/'^\\(>*From \\)/>\\1/'\n\nThus the result of git-send-email would be a series of emails\nconcatenated to stdout, with From lines escaped appropriately.\n\nHave fun,\n\nAvery\n"}]}