{"thread":{"id":"14674","subject":"[PATCH] Avoid warning when From: is encoded","startedAt":"2008-07-25T13:06:48Z","lastAt":"2008-07-26T02:53:30Z","messageCount":7,"participants":["Peter Valdemar Mørch","Abhijit Menon-Sen","Sverre Rabbelier","Junio C Hamano","Jon Loeliger","Jeff King","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"84877","messageId":"1216991208-18782-1-git-send-email-4ux6as402@sneakemail.com","threadId":"14674","inReplyTo":null,"subject":"[PATCH] Avoid warning when From: is encoded","fromName":"Peter Valdemar Mørch","fromEmail":"4ux6as402@sneakemail.com","sentAt":"2008-07-25T13:06:48Z","receivedAt":"2008-07-25T13:06:48Z","isPatch":true,"sender":{"key":"4ux6as402@sneakemail.com","avatar":null},"body":"From: Peter Valdemar Mørch <peter@morch.com>\n\nIn commit 0706bd19ef9b41e7519df2c73796ef93484272fd $1 is used from a regexp\nwithout using () to set up $1. Later, when that value was used, it caused a\nwarning about a variable being undefined.\n\nSigned-off-by: Peter Valdemar Mørch <peter@morch.com>\n---\nThe commit introduces $body_encoding and: $body_encoding = $1; which is undef.\n\nThat commit then later uses $body_encoding only here:\n+ if ($has_content_type) {\n+         if ($body_encoding eq $author_encoding) {\n+                 # ok, we already have the right encoding\n+         }\n+         else {\n+                 # uh oh, we should re-encode\n+         }\n+ }\n(I removed some whitespace for readability)\n\n.. and it was the eq that gave the warning, because $body_encoding was\nundefined. Perhaps a better fix is to remove $body_encoding and regexp\naltogether since it isn't really used. Let me know if you think so.\n\nThis is where my non-commit message goes, yeah? I'm hand editing the output of\n'git format-patch'...\n\nJunio C. Hamano commented on a previous post that I shouldn't send patches as\nattachments so now I'm trying git-send-email. Are there any form problems with\nthis patch?\n\n git-send-email.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 2e4a44a..d2fd899 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -882,7 +882,7 @@ foreach my $t (@files) {\n \t\t\t\t}\n \t\t\t\telsif (/^Content-type:/i) {\n \t\t\t\t\t$has_content_type = 1;\n-\t\t\t\t\tif (/charset=\"?[^ \"]+/) {\n+\t\t\t\t\tif (/charset=\"?([^ \"]+)/) {\n \t\t\t\t\t\t$body_encoding = $1;\n \t\t\t\t\t}\n \t\t\t\t\tpush @xh, $_;\n-- \n1.6.0.rc0.46.g07955.dirty\n"},{"id":"84880","messageId":"20080725131625.GA11221@toroid.org","threadId":"14674","inReplyTo":"1216991208-18782-1-git-send-email-4ux6as402@sneakemail.com","subject":"Re: [PATCH] Avoid warning when From: is encoded","fromName":"Abhijit Menon-Sen","fromEmail":"ams@toroid.org","sentAt":"2008-07-25T13:16:25Z","receivedAt":"2008-07-25T13:16:25Z","isPatch":true,"sender":{"key":"ams@toroid.org","avatar":null},"body":"At 2008-07-25 15:06:48 +0200, 4ux6as402@sneakemail.com wrote:\n>\n> This is where my non-commit message goes, yeah?\n\nYes.\n\n> Are there any form problems with this patch?\n\nLooks fine to me (and also to git am).\n\nThe patch itself also looks good to me (but I'm not sure if that means I\nshould add an Acked-by: line to this message).\n\n-- ams\n"},{"id":"84894","messageId":"bd6139dc0807250901n7408a8e6w5dead238e897fc03@mail.gmail.com","threadId":"14674","inReplyTo":"20080725131625.GA11221@toroid.org","subject":"Re: [PATCH] Avoid warning when From: is encoded","fromName":"Sverre Rabbelier","fromEmail":"alturin@gmail.com","sentAt":"2008-07-25T16:01:31Z","receivedAt":"2008-07-25T16:01:31Z","isPatch":true,"sender":{"key":"alturin@gmail.com","avatar":null},"body":"On Fri, Jul 25, 2008 at 15:16, Abhijit Menon-Sen <ams@toroid.org> wrote:\n> At 2008-07-25 15:06:48 +0200, 4ux6as402@sneakemail.com wrote:\n>> Are there any form problems with this patch?\n\nUsually the \"comment\" part is indented by at least one level, but\nafaik that's just etiquette and is not mandatory.\n\n> The patch itself also looks good to me (but I'm not sure if that means I\n> should add an Acked-by: line to this message).\n\nAcked-by is reserved for people who are \"owners\" of the area the patch\ntouches. So for example, a patch to git-gui could be Acked-by Shawn O.\nPierce, or one related to pack format by Nico (I think?). So you\nshould Ack it if you have done (a lot of) work in the same area as the\npatch before and if the patch looks good.\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"84900","messageId":"7vhcadudmz.fsf@gitster.siamese.dyndns.org","threadId":"14674","inReplyTo":"1216991208-18782-1-git-send-email-4ux6as402@sneakemail.com","subject":"Re: [PATCH] Avoid warning when From: is encoded","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-25T16:33:56Z","receivedAt":"2008-07-25T16:33:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Peter Valdemar Mørch  <4ux6as402@sneakemail.com> writes:\n\n> From: Peter Valdemar Mørch <peter@morch.com>\n>\n> In commit 0706bd19ef9b41e7519df2c73796ef93484272fd $1 is used from a regexp\n> without using () to set up $1. Later, when that value was used, it caused a\n> warning about a variable being undefined.\n>\n> Signed-off-by: Peter Valdemar Mørch <peter@morch.com>\n\nThanks.  The patch is obviously correct; I think you are fixing 8291db6\n(git-send-email: add charset header if we add encoded 'From', 2007-11-16),\nnot 0706bd1 (send-email: specify content-type of --compose body,\n2008-03-28).\n\nWill apply to maint and merge upwards.\n"},{"id":"84902","messageId":"488A01B8.2010405@freescale.com","threadId":"14674","inReplyTo":"bd6139dc0807250901n7408a8e6w5dead238e897fc03@mail.gmail.com","subject":"Re: [PATCH] Avoid warning when From: is encoded","fromName":"Jon Loeliger","fromEmail":"jdl@freescale.com","sentAt":"2008-07-25T16:39:20Z","receivedAt":"2008-07-25T16:39:20Z","isPatch":true,"sender":{"key":"jdl@jdl.com","avatar":"https://gravatar.com/avatar/75ce9a10b151acd2c28ec4ab2136dba7b2ff1634530bd04b155981a749d08a64?d=mp&s=160"},"body":"Sverre Rabbelier wrote:\n\n> Acked-by is reserved for people who are \"owners\" of the area the patch\n> touches.\n\nI love pronouncements like this.  While that may be exactly true\nfor the Git project, it is not, in general, always true.  Within\nparts of the Kernel development process, anyone who wants to may\nACK a patch if they have done some level of work to confirm that\nit \"is good\", for some measure of \"good\", even if that is just\napplying the patch and testing it.  It is re-assurance that other\npeople consider the patch acceptable.\n\nOf course, if there are, say, multiple functional areas with\ndifferent maintainers, and the patch should go in via one repository\nbut crosses into a second or third functional area, getting the\nACK from the other maintainers may be considered essential for\nits ultimate acceptance.  In that regard, yes, the maintainer's\nACK carries more weight.\n\n> So for example, a patch to git-gui could be Acked-by Shawn O.\n> Pierce, or one related to pack format by Nico (I think?). So you\n> should Ack it if you have done (a lot of) work in the same area as the\n> patch before and if the patch looks good.\n\nAgreed.\n\njdl\n"},{"id":"84919","messageId":"20080725183857.GE4375@sigill.intra.peff.net","threadId":"14674","inReplyTo":"7vhcadudmz.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Avoid warning when From: is encoded","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-07-25T18:38:57Z","receivedAt":"2008-07-25T18:38:57Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jul 25, 2008 at 09:33:56AM -0700, Junio C Hamano wrote:\n\n> > In commit 0706bd19ef9b41e7519df2c73796ef93484272fd $1 is used from a regexp\n> > without using () to set up $1. Later, when that value was used, it caused a\n> > warning about a variable being undefined.\n> >\n> > Signed-off-by: Peter Valdemar Mørch <peter@morch.com>\n> \n> Thanks.  The patch is obviously correct; I think you are fixing 8291db6\n> (git-send-email: add charset header if we add encoded 'From', 2007-11-16),\n> not 0706bd1 (send-email: specify content-type of --compose body,\n> 2008-03-28).\n> \n> Will apply to maint and merge upwards.\n\nDiscussions about who can ACK this code aside, the original bogosity was\ntotally mine, so\n\n  Acked-by: Jeff King <peff@peff.net>\n\n-Peff\n"},{"id":"84991","messageId":"alpine.DEB.1.00.0807260449490.26810@eeepc-johanness","threadId":"14674","inReplyTo":"488A01B8.2010405@freescale.com","subject":"Re: [PATCH] Avoid warning when From: is encoded","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-26T02:53:30Z","receivedAt":"2008-07-26T02:53:30Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 25 Jul 2008, Jon Loeliger wrote:\n\n> Sverre Rabbelier wrote:\n> \n> > Acked-by is reserved for people who are \"owners\" of the area the patch\n> > touches.\n> \n> I love pronouncements like this.  While that may be exactly true\n> for the Git project, it is not, in general, always true.\n\nIt may not be true in general, but from what I heard of the Kernel \ncommunity, even there it is considered rude if you just step in and say \nACK, when you clearly have no idea what you are talking about (which is \nnormally determined by your being involved in that area).\n\nSo you can love (or not) pronouncements like that, but the fact still \nstands true: how can your ACK be of any value (or for that matter, how can \nyour ACK be taken seriously) when you haven't proven -- in code! -- that \nyou understand the code?\n\nHthab,\nDscho\n"}]}