{"thread":{"id":"11328","subject":"Re: [PATCH] include/asm-arm/: Spelling fixes","startedAt":"2007-12-17T20:12:19Z","lastAt":"2008-01-08T11:16:58Z","messageCount":9,"participants":["J. Bruce Fields","Joe Perches","Jeff King","Junio C Hamano","Josh Triplett"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"63467","messageId":"20071217201219.GC13515@fieldses.org","threadId":"11328","inReplyTo":"1197921847.27386.16.camel@localhost","subject":"Re: [PATCH] include/asm-arm/: Spelling fixes","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2007-12-17T20:12:19Z","receivedAt":"2007-12-17T20:12:19Z","isPatch":true,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"Hope you don't mind my cc'ing the git list:\n\nOn Mon, Dec 17, 2007 at 12:04:07PM -0800, Joe Perches wrote:\n> On Mon, 2007-12-17 at 14:56 -0500, J. Bruce Fields wrote:\n> > My mail client seems to be flagging all your messages as duplicates of each\n> > other.\n> > \n> > Hm.  It may be that your headers have two Message-Id's...\n> > Message-Id: <1197919875-5288-3-git-send-email-joe@perches.com>\n> > X-Mailer: git-send-email 1.5.3.7.949.g2221a6\n> > Message-Id:\n> >         <5703e57f925f31fc0eb38873bd7f10fc44f99cb4.1197918889.git.joe@perches.com\n> >         >\n> > \n> > ... the second of which is pretty weird (and is the same for every message.  Is\n> > that a git-send-email bug or something else?\n> \n> Dunno.  I did a git-format-patch, then git-send-email.\n\nWeird.  Anyone know how that could happen?\n\n--b.\n"},{"id":"63470","messageId":"1197922971.27386.32.camel@localhost","threadId":"11328","inReplyTo":"20071217201219.GC13515@fieldses.org","subject":"Re: [PATCH] include/asm-arm/: Spelling fixes","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2007-12-17T20:22:51Z","receivedAt":"2007-12-17T20:22:51Z","isPatch":true,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"On Mon, 2007-12-17 at 15:12 -0500, J. Bruce Fields wrote:\n> Hope you don't mind my cc'ing the git list:\n\nNope.  Not a bit.\n\nI had patches that were committed in word order that\nI wanted to aggregate by subsystem.\n\nI took all the patches, created a branch, committed\nall the patches at once, then used these commands:\n \n(patch_order is a directory list)\n\n$ let count=0 ; for line in $(cat patch_order) ; do ((count++)); \\\n\tprintf -v tmp \"%04u-Spelling-%s\" $count $line ; \\\n\ttmp=${tmp//\\//-} ; tmp=${tmp// /}; \\\n\tgit-format-patch -N --thread --start-number $count -s \\\n\t-o patch3 \\\n\t--subject-prefix=\"[PATCH] Spelling: $line\" master $line  ; done\n[converted the subjects appropriately]\n$ git-send-email --smtp-server <foo> --smtp-user <bar> \\\n\t--from \"Joe Perches <joe@perches.com>\" \\\n\t--to \"linux-kernel@vger.kernel.org\" \\\n\t--cc \"Andrew Morton <akpm@linux-foundation.org>\" \\\n\t--cc-cmd \"../get_maintainer.pl --nogit\" \\\n\t--no-thread --suppress-from patch3\n\nI probably just reversed the \"--thread\" on\ngit-format-patch and send-email.\n\ncheers, Joe\n"},{"id":"63477","messageId":"20071217205134.GB2105@coredump.intra.peff.net","threadId":"11328","inReplyTo":"1197922971.27386.32.camel@localhost","subject":"Re: [PATCH] include/asm-arm/: Spelling fixes","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-12-17T20:51:34Z","receivedAt":"2007-12-17T20:51:34Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Dec 17, 2007 at 12:22:51PM -0800, Joe Perches wrote:\n\n> $ let count=0 ; for line in $(cat patch_order) ; do ((count++)); \\\n> \tprintf -v tmp \"%04u-Spelling-%s\" $count $line ; \\\n> \ttmp=${tmp//\\//-} ; tmp=${tmp// /}; \\\n> \tgit-format-patch -N --thread --start-number $count -s \\\n> \t-o patch3 \\\n> \t--subject-prefix=\"[PATCH] Spelling: $line\" master $line  ; done\n> [converted the subjects appropriately]\n> $ git-send-email --smtp-server <foo> --smtp-user <bar> \\\n> \t--from \"Joe Perches <joe@perches.com>\" \\\n> \t--to \"linux-kernel@vger.kernel.org\" \\\n> \t--cc \"Andrew Morton <akpm@linux-foundation.org>\" \\\n> \t--cc-cmd \"../get_maintainer.pl --nogit\" \\\n> \t--no-thread --suppress-from patch3\n\nAh. The problem is that git-send-email unconditionally adds a\nmessage-id. Usually git-format-patch doesn't add one, but for obvious\nreasons, it must when doing --thread. Here is a fix.\n\n-- >8 --\ngit-send-email: avoid duplicate message-ids\n\nWe used to unconditionally add a message-id to the outgoing\nemail without bothering to check if it already had one.\nInstead, let's use the existing one.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nIt will also happily add duplicate --in-reply-to and --references\nheaders, but those can be suppressed with --no-thread. Arguably, it\nshould detect this case and turn on --no-thread, but looking at\ngit-send-email makes me want to claw my eyes out.\n\n git-send-email.perl |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 1d6f466..083466a 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -580,7 +580,7 @@ sub send_message\n \t\t$ccline = \"\\nCc: $cc\";\n \t}\n \tmy $sanitized_sender = sanitize_address($sender);\n-\tmake_message_id();\n+\tmake_message_id() unless defined($message_id);\n \n \tmy $header = \"From: $sanitized_sender\n To: $to${ccline}\n@@ -718,6 +718,9 @@ foreach my $t (@files) {\n \t\t\t\t\t}\n \t\t\t\t\tpush @xh, $_;\n \t\t\t\t}\n+\t\t\t\telsif (/^Message-Id: (.*)/i) {\n+\t\t\t\t\t$message_id = $1;\n+\t\t\t\t}\n \t\t\t\telsif (!/^Date:\\s/ && /^[-A-Za-z]+:\\s+\\S/) {\n \t\t\t\t\tpush @xh, $_;\n \t\t\t\t}\n-- \n1.5.4.rc0.1146.gc97f-dirty\n"},{"id":"63488","messageId":"7vy7bt57wn.fsf@gitster.siamese.dyndns.org","threadId":"11328","inReplyTo":"20071217205134.GB2105@coredump.intra.peff.net","subject":"Re: [PATCH] include/asm-arm/: Spelling fixes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-17T21:27:20Z","receivedAt":"2007-12-17T21:27:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Ah. The problem is that git-send-email unconditionally adds a\n> message-id. Usually git-format-patch doesn't add one, but for obvious\n> reasons, it must when doing --thread. Here is a fix.\n\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index 1d6f466..083466a 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -580,7 +580,7 @@ sub send_message\n>  \t\t$ccline = \"\\nCc: $cc\";\n>  \t}\n>  \tmy $sanitized_sender = sanitize_address($sender);\n> -\tmake_message_id();\n> +\tmake_message_id() unless defined($message_id);\n\nIsn't this called inside a loop?  If the outgoing message does not\noriginally have \"Message-Id:\", does the loop correctly reinitialize\n$message_id to undef, or does this change make everybody reuse the same\n$message_id over and over again?\n\nI have a feeling that --thread to format-patch is a misfeature.  Why is\nit needed if you are feeding the output to send-email?\n\nI wonder if stripping existing \"Message-Id:\" away just like we strip\naway \"Date:\" from @xh would be a much saner fix.\n"},{"id":"63512","messageId":"20071217230558.GD2105@coredump.intra.peff.net","threadId":"11328","inReplyTo":"7vy7bt57wn.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] include/asm-arm/: Spelling fixes","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-12-17T23:05:58Z","receivedAt":"2007-12-17T23:05:58Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Dec 17, 2007 at 01:27:20PM -0800, Junio C Hamano wrote:\n\n> >  \tmy $sanitized_sender = sanitize_address($sender);\n> > -\tmake_message_id();\n> > +\tmake_message_id() unless defined($message_id);\n> \n> Isn't this called inside a loop?  If the outgoing message does not\n> originally have \"Message-Id:\", does the loop correctly reinitialize\n> $message_id to undef, or does this change make everybody reuse the same\n> $message_id over and over again?\n\nYes, sorry. I realized it right after I sent the other out, but then a\nrepairman showed up to fix my non-working furnace. :)\n\nThe following needs to be squashed in (alternatively, the message_id\ndoesn't need to be a loop variable, so it could be cleaned up. But part\nof me says that git-send-email is beyond hope for being clean).\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 083466a..248d035 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -808,6 +808,7 @@ foreach my $t (@files) {\n \t\t\t$references = \"$message_id\";\n \t\t}\n \t}\n+\t$message_id = undef;\n }\n \n if ($compose) {\n\n> I have a feeling that --thread to format-patch is a misfeature.  Why is\n> it needed if you are feeding the output to send-email?\n\nI think it is a case of --thread being added for people not using\nsend-email, and then getting it misused. I am just trying to add a\nsanity check to send-email in case the user does something silly (though\none could certainly argue that it is already hopelessly tied to\ngit-format-patch, and fixing git-format-patch is the right way to go).\n\n> I wonder if stripping existing \"Message-Id:\" away just like we strip\n> away \"Date:\" from @xh would be a much saner fix.\n\nThat is definitely wrong if we expect to re-use the in-reply-to and\nreferences headers that already exist (though obviously we could strip\nout all three of those headers and re-add our own).\n\nI don't have a strong opinion. I never use git-send-email myself, but\nwas just trying to fix a reported bug.\n\n-Peff\n"},{"id":"63518","messageId":"20071217231209.GA5558@coredump.intra.peff.net","threadId":"11328","inReplyTo":"20071217230558.GD2105@coredump.intra.peff.net","subject":"Re: [PATCH] include/asm-arm/: Spelling fixes","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-12-17T23:12:09Z","receivedAt":"2007-12-17T23:12:09Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Dec 17, 2007 at 06:05:58PM -0500, Jeff King wrote:\n\n> > I wonder if stripping existing \"Message-Id:\" away just like we strip\n> > away \"Date:\" from @xh would be a much saner fix.\n> \n> That is definitely wrong if we expect to re-use the in-reply-to and\n> references headers that already exist (though obviously we could strip\n> out all three of those headers and re-add our own).\n> \n> I don't have a strong opinion. I never use git-send-email myself, but\n> was just trying to fix a reported bug.\n\nActually, I don't think stripping the message-id is ever the right\nthing. The user put it in there for some purpose, and \"ours not to\nreason why\" (ours but to do and die). IOW, it is not possible for us to\nknow what we are breaking by changing the message-id. It could simply be\nthe reply-to header in the following messages, or it could be the\nreply-to in some message we have not and will not ever see.\n\nEven if we assume git-send-email only ever gets the unmunged output of\ngit-format-patch, we do not necessarily know it has been fed all of the\npatches during a single run.\n\n-Peff\n"},{"id":"63523","messageId":"7v7ijc6gvf.fsf@gitster.siamese.dyndns.org","threadId":"11328","inReplyTo":"20071217230558.GD2105@coredump.intra.peff.net","subject":"Re: [PATCH] include/asm-arm/: Spelling fixes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-17T23:28:20Z","receivedAt":"2007-12-17T23:28:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n>> I wonder if stripping existing \"Message-Id:\" away just like we strip\n>> away \"Date:\" from @xh would be a much saner fix.\n>\n> That is definitely wrong if we expect to re-use the in-reply-to and\n> references headers that already exist (though obviously we could strip\n> out all three of those headers and re-add our own).\n\nAh, you are right.\n\nAnd undef $message_id you squashed in definitely belongs there --\n\"prepare for the next round\" section.\n"},{"id":"64724","messageId":"47835B5F.3030204@freedesktop.org","threadId":"11328","inReplyTo":"7vy7bt57wn.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] include/asm-arm/: Spelling fixes","fromName":"Josh Triplett","fromEmail":"josh@freedesktop.org","sentAt":"2008-01-08T11:15:43Z","receivedAt":"2008-01-08T11:15:43Z","isPatch":true,"sender":{"key":"josh@joshtriplett.org","avatar":"https://avatars.githubusercontent.com/u/162737?v=4"},"body":"Junio C Hamano wrote:\n> Jeff King <peff@peff.net> writes:\n>> Ah. The problem is that git-send-email unconditionally adds a\n>> message-id. Usually git-format-patch doesn't add one, but for obvious\n>> reasons, it must when doing --thread. Here is a fix.\n> \n>> diff --git a/git-send-email.perl b/git-send-email.perl\n>> index 1d6f466..083466a 100755\n>> --- a/git-send-email.perl\n>> +++ b/git-send-email.perl\n>> @@ -580,7 +580,7 @@ sub send_message\n>>  \t\t$ccline = \"\\nCc: $cc\";\n>>  \t}\n>>  \tmy $sanitized_sender = sanitize_address($sender);\n>> -\tmake_message_id();\n>> +\tmake_message_id() unless defined($message_id);\n> \n> Isn't this called inside a loop?  If the outgoing message does not\n> originally have \"Message-Id:\", does the loop correctly reinitialize\n> $message_id to undef, or does this change make everybody reuse the same\n> $message_id over and over again?\n> \n> I have a feeling that --thread to format-patch is a misfeature.  Why is\n> it needed if you are feeding the output to send-email?\n\nI added that option; see (d1566f7883f727f38bf442af3fdb69d36e6fcea2,\ncc35de8470541e389b7d2bdda4c901574720fa81, and\nda56645dd7c1175fc2ed1628ac35fdd35e705641).  I use git-imap-send, not\ngit-send-email, and I wanted to thread my patches.\n\n- Josh Triplett\n"},{"id":"64726","messageId":"47835BAA.3090100@freedesktop.org","threadId":"11328","inReplyTo":"7vy7bt57wn.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] include/asm-arm/: Spelling fixes","fromName":"Josh Triplett","fromEmail":"josh@freedesktop.org","sentAt":"2008-01-08T11:16:58Z","receivedAt":"2008-01-08T11:16:58Z","isPatch":true,"sender":{"key":"josh@joshtriplett.org","avatar":"https://avatars.githubusercontent.com/u/162737?v=4"},"body":"Junio C Hamano wrote:\n> Jeff King <peff@peff.net> writes:\n>> Ah. The problem is that git-send-email unconditionally adds a\n>> message-id. Usually git-format-patch doesn't add one, but for obvious\n>> reasons, it must when doing --thread. Here is a fix.\n> \n>> diff --git a/git-send-email.perl b/git-send-email.perl\n>> index 1d6f466..083466a 100755\n>> --- a/git-send-email.perl\n>> +++ b/git-send-email.perl\n>> @@ -580,7 +580,7 @@ sub send_message\n>>  \t\t$ccline = \"\\nCc: $cc\";\n>>  \t}\n>>  \tmy $sanitized_sender = sanitize_address($sender);\n>> -\tmake_message_id();\n>> +\tmake_message_id() unless defined($message_id);\n> \n> Isn't this called inside a loop?  If the outgoing message does not\n> originally have \"Message-Id:\", does the loop correctly reinitialize\n> $message_id to undef, or does this change make everybody reuse the same\n> $message_id over and over again?\n> \n> I have a feeling that --thread to format-patch is a misfeature.  Why is\n> it needed if you are feeding the output to send-email?\n\nI added that option; see (d1566f7883f727f38bf442af3fdb69d36e6fcea2,\ncc35de8470541e389b7d2bdda4c901574720fa81, and\nda56645dd7c1175fc2ed1628ac35fdd35e705641).  I use git-imap-send, not\ngit-send-email, and I wanted to thread my patches.\n\n- Josh Triplett\n"}]}