{"thread":{"id":"24907","subject":"git send-email doesn't take To: addresses from the patch","startedAt":"2010-08-30T07:05:55Z","lastAt":"2010-09-03T17:18:24Z","messageCount":6,"participants":["viresh kumar","Stephen Boyd","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"149286","messageId":"4C7B5853.7010001@st.com","threadId":"24907","inReplyTo":null,"subject":"git send-email doesn't take To: addresses from the patch","fromName":"viresh kumar","fromEmail":"viresh.kumar@st.com","sentAt":"2010-08-30T07:05:55Z","receivedAt":"2010-08-30T07:05:55Z","isPatch":false,"sender":{"key":"viresh.kumar@st.com","avatar":null},"body":"Hi,\n\nI am using git-1.7.2 and use following command to generate a patch\n\n$ git format-patch --to abc@xyz.com HEAD^\n\nNow when I use git send-email to send this patch, it is not taking the\nTo: embedded in the patch as its destination, instead it asks for one\nand if not provided it keeps this field empty.\nOn the other hand git send-email is taking the Cc addresses from\nthe patch perfectly in to account.\n\nHow can I use git send-email to pick To: addresses directly from the\npatch.\n\nregards\nViresh Kumar\n"},{"id":"149535","messageId":"4C7E05B5.1050805@gmail.com","threadId":"24907","inReplyTo":"4C7B5853.7010001@st.com","subject":"Re: git send-email doesn't take To: addresses from the patch","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-09-01T07:50:13Z","receivedAt":"2010-09-01T07:50:13Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"  On 08/30/2010 12:05 AM, viresh kumar wrote:\n> Hi,\n>\n> I am using git-1.7.2 and use following command to generate a patch\n>\n> $ git format-patch --to abc@xyz.com HEAD^\n>\n> Now when I use git send-email to send this patch, it is not taking the\n> To: embedded in the patch as its destination, instead it asks for one\n> and if not provided it keeps this field empty.\n> On the other hand git send-email is taking the Cc addresses from\n> the patch perfectly in to account.\n>\n> How can I use git send-email to pick To: addresses directly from the\n> patch.\n\nYou can't. Nobody has bothered to make git-send-email consider the To: field. Can you try this patch out? I think it will mostly work, except I haven't bothered to look at --compose yet and I'm halfway stumbling through this code right now.\n\n---->8-----\n\nSubject: [PATCH] send-email: Use To: headers in patch files\n\nIt's a minor annoyance when you take the painstaking time to setup To:\nheaders for each patch in a large series, and then go out to send the\nseries with git-send-email and watch git ignore the To: headers in the\npatch files.\n\nTherefore, always add To: headers from a patch file to the To: headers\nfor that message. Keep the prompt for the blanket To: header so as to\nnot break scripts (and user expectations). This means even if a patch has a\nTo: header, git will prompt for the To: address. Otherwise, we'll need to\nintroduce interface breakage to either request the header for each patch\nmissing a To: header or default the header to whatever To: address is found\nfirst (be it in a patch or from user input). Both of these options don't seem\nvery obvious/useful.\n\nReported-by: viresh kumar<viresh.kumar@st.com>\nSigned-off-by: Stephen Boyd<bebarino@gmail.com>\n---\n  git-send-email.perl |    7 +++++++\n  1 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 6dab3bf..06373ed 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1176,6 +1176,13 @@ foreach my $t (@files) {\n  \t\t\t\t\t$1, $_) unless $quiet;\n  \t\t\t\tpush @cc, $1;\n  \t\t\t}\n+\t\t\telsif (/^To:\\s+(.*)$/) {\n+\t\t\t\tforeach my $addr (parse_address_line($1)) {\n+\t\t\t\t\tprintf(\"(mbox) Adding to: %s from line '%s'\\n\",\n+\t\t\t\t\t\t$addr, $_) unless $quiet;\n+\t\t\t\t\tpush @to, sanitize_address($addr);\n+\t\t\t\t}\n+\t\t\t}\n  \t\t\telsif (/^Cc:\\s+(.*)$/) {\n  \t\t\t\tforeach my $addr (parse_address_line($1)) {\n  \t\t\t\t\tif (unquote_rfc2047($addr) eq $sender) {\n-- \n1.7.2.2.178.gd8a94\n"},{"id":"149539","messageId":"4C7E1537.9030405@st.com","threadId":"24907","inReplyTo":"4C7E05B5.1050805@gmail.com","subject":"Re: git send-email doesn't take To: addresses from the patch","fromName":"viresh kumar","fromEmail":"viresh.kumar@st.com","sentAt":"2010-09-01T08:56:23Z","receivedAt":"2010-09-01T08:56:23Z","isPatch":false,"sender":{"key":"viresh.kumar@st.com","avatar":null},"body":"On 9/1/2010 1:20 PM, Stephen Boyd wrote:\n> Subject: [PATCH] send-email: Use To: headers in patch files\n> \n> It's a minor annoyance when you take the painstaking time to setup To:\n> headers for each patch in a large series, and then go out to send the\n> series with git-send-email and watch git ignore the To: headers in the\n> patch files.\n> \n> Therefore, always add To: headers from a patch file to the To: headers\n> for that message. Keep the prompt for the blanket To: header so as to\n> not break scripts (and user expectations). This means even if a patch has a\n> To: header, git will prompt for the To: address. Otherwise, we'll need to\n> introduce interface breakage to either request the header for each patch\n> missing a To: header or default the header to whatever To: address is found\n> first (be it in a patch or from user input). Both of these options don't seem\n> very obvious/useful.\n> \n> Reported-by: viresh kumar<viresh.kumar@st.com>\n> Signed-off-by: Stephen Boyd<bebarino@gmail.com>\n\nTested-by: Viresh Kumar <viresh.kumar@st.com>\n"},{"id":"149669","messageId":"AANLkTi=xQAoEFiB2zGz73ZwSwq16LOthkqd7w1GhnEup@mail.gmail.com","threadId":"24907","inReplyTo":"4C7E1537.9030405@st.com","subject":"Re: git send-email doesn't take To: addresses from the patch","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-09-02T18:36:38Z","receivedAt":"2010-09-02T18:36:38Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On Wed, Sep 1, 2010 at 1:56 AM, viresh kumar <viresh.kumar@st.com> wrote:\n> On 9/1/2010 1:20 PM, Stephen Boyd wrote:\n>> Subject: [PATCH] send-email: Use To: headers in patch files\n>>\n>> It's a minor annoyance when you take the painstaking time to setup To:\n>> headers for each patch in a large series, and then go out to send the\n>> series with git-send-email and watch git ignore the To: headers in the\n>> patch files.\n>>\n>> Therefore, always add To: headers from a patch file to the To: headers\n>> for that message. Keep the prompt for the blanket To: header so as to\n>> not break scripts (and user expectations). This means even if a patch has a\n>> To: header, git will prompt for the To: address. Otherwise, we'll need to\n>> introduce interface breakage to either request the header for each patch\n>> missing a To: header or default the header to whatever To: address is found\n>> first (be it in a patch or from user input). Both of these options don't seem\n>> very obvious/useful.\n>>\n>> Reported-by: viresh kumar<viresh.kumar@st.com>\n>> Signed-off-by: Stephen Boyd<bebarino@gmail.com>\n>\n> Tested-by: Viresh Kumar <viresh.kumar@st.com>\n>\n\nCool. Junio, does this look good to you? I can squash in some tests\nlater tonight if I get some git time.\n"},{"id":"149747","messageId":"4C80733B.2020406@st.com","threadId":"24907","inReplyTo":"AANLkTi=xQAoEFiB2zGz73ZwSwq16LOthkqd7w1GhnEup@mail.gmail.com","subject":"Re: git send-email doesn't take To: addresses from the patch","fromName":"viresh kumar","fromEmail":"viresh.kumar@st.com","sentAt":"2010-09-03T04:02:03Z","receivedAt":"2010-09-03T04:02:03Z","isPatch":false,"sender":{"key":"viresh.kumar@st.com","avatar":null},"body":"On 9/3/2010 12:06 AM, Stephen Boyd wrote:\n> Cool. Junio, does this look good to you? I can squash in some tests\n> later tonight if I get some git time.\n\nIt works perfectly fine for me.\n\nthanks\nviresh\n"},{"id":"149766","messageId":"7vk4n2zqxr.fsf@alter.siamese.dyndns.org","threadId":"24907","inReplyTo":"AANLkTi=xQAoEFiB2zGz73ZwSwq16LOthkqd7w1GhnEup@mail.gmail.com","subject":"Re: git send-email doesn't take To: addresses from the patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-03T17:18:24Z","receivedAt":"2010-09-03T17:18:24Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephen Boyd <bebarino@gmail.com> writes:\n\n> On Wed, Sep 1, 2010 at 1:56 AM, viresh kumar <viresh.kumar@st.com> wrote:\n>> On 9/1/2010 1:20 PM, Stephen Boyd wrote:\n>>> Subject: [PATCH] send-email: Use To: headers in patch files\n> ...\n> Cool. Junio, does this look good to you? I can squash in some tests\n> later tonight if I get some git time.\n\nSounds sane; thanks.\n"}]}