{"thread":{"id":"14775","subject":"[StGIT PATCH] Do not mess-up with commit message formatting when sending email","startedAt":"2008-07-31T12:50:05Z","lastAt":"2008-08-05T20:48:27Z","messageCount":5,"participants":["Samuel Tardieu","Karl Hasselström","Catalin Marinas"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"85774","messageId":"20080731125005.894.10592.stgit@dawn.rfc1149.net","threadId":"14775","inReplyTo":null,"subject":"[StGIT PATCH] Do not mess-up with commit message formatting when sending email","fromName":"Samuel Tardieu","fromEmail":"sam@rfc1149.net","sentAt":"2008-07-31T12:50:05Z","receivedAt":"2008-07-31T12:50:05Z","isPatch":true,"sender":{"key":"sam@rfc1149.net","avatar":"https://avatars.githubusercontent.com/u/44656?v=4"},"body":"The short description, which will be used as the email subject,\ngets its leading and trailing whitespaces removed.\n\nThe long description only gets its trailing whitespaces removed\nto preserve commit message formatting, e.g. in the case of a\nChangeLog-style commit message, as well as empty leading lines.\n\nSigned-off-by: Samuel Tardieu <sam@rfc1149.net>\n---\n stgit/commands/mail.py |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/stgit/commands/mail.py b/stgit/commands/mail.py\nindex a833efc..bdc3fcc 100644\n--- a/stgit/commands/mail.py\n+++ b/stgit/commands/mail.py\n@@ -401,8 +401,8 @@ def __build_message(tmpl, patch, patch_nr, total_nr, msg_id, ref_id, options):\n         options.edit_patches = True\n \n     descr_lines = descr.split('\\n')\n-    short_descr = descr_lines[0].rstrip()\n-    long_descr = '\\n'.join(descr_lines[1:]).lstrip()\n+    short_descr = descr_lines[0].strip()\n+    long_descr = '\\n'.join([l.rstrip() for l in descr_lines[1:]]).lstrip('\\n')\n \n     authname = p.get_authname();\n     authemail = p.get_authemail();\n"},{"id":"86185","messageId":"20080804141640.GB12232@diana.vm.bytemark.co.uk","threadId":"14775","inReplyTo":"20080731125005.894.10592.stgit@dawn.rfc1149.net","subject":"Re: [StGIT PATCH] Do not mess-up with commit message formatting when sending email","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-08-04T14:16:40Z","receivedAt":"2008-08-04T14:16:40Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-07-31 14:50:05 +0200, Samuel Tardieu wrote:\n\n> The short description, which will be used as the email subject, gets\n> its leading and trailing whitespaces removed.\n\nOK, good.\n\n> The long description only gets its trailing whitespaces removed to\n> preserve commit message formatting, e.g. in the case of a\n> ChangeLog-style commit message, as well as empty leading lines.\n\nI'd like a better description of this change, please. If I'm not\nmistaken, we used to do _only_ left stripping of the body. You change\nthat to left stripping of only newlines, but also add right stripping\nfor each line. I'm all for these changes, but the commit message\nconfused me a lot.\n\n> -    long_descr = '\\n'.join(descr_lines[1:]).lstrip()\n> +    long_descr = '\\n'.join([l.rstrip() for l in descr_lines[1:]]).lstrip('\\n')\n\nWe require Python 2.4 or later, so you can skip the square brackets\nhere.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"86204","messageId":"20080804151913.4269.74254.stgit@dawn.rfc1149.net","threadId":"14775","inReplyTo":"20080804141640.GB12232@diana.vm.bytemark.co.uk","subject":"[StGIT v2 PATCH] Do not mess-up with commit message formatting when sending email","fromName":"Samuel Tardieu","fromEmail":"sam@rfc1149.net","sentAt":"2008-08-04T15:19:14Z","receivedAt":"2008-08-04T15:19:14Z","isPatch":true,"sender":{"key":"sam@rfc1149.net","avatar":"https://avatars.githubusercontent.com/u/44656?v=4"},"body":"The short description, which will be used as the email subject,\ngets its leading and trailing blanks removed.\n\nThe long description gets its trailing blanks removed as well\nas any leading empty lines. Leading blanks are left untouched\nto preserve the formatting.\n\nSigned-off-by: Samuel Tardieu <sam@rfc1149.net>\n---\n stgit/commands/mail.py |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/stgit/commands/mail.py b/stgit/commands/mail.py\nindex a833efc..61e3f3a 100644\n--- a/stgit/commands/mail.py\n+++ b/stgit/commands/mail.py\n@@ -401,8 +401,8 @@ def __build_message(tmpl, patch, patch_nr, total_nr, msg_id, ref_id, options):\n         options.edit_patches = True\n \n     descr_lines = descr.split('\\n')\n-    short_descr = descr_lines[0].rstrip()\n-    long_descr = '\\n'.join(descr_lines[1:]).lstrip()\n+    short_descr = descr_lines[0].strip()\n+    long_descr = '\\n'.join(l.rstrip() for l in descr_lines[1:]).lstrip('\\n')\n \n     authname = p.get_authname();\n     authemail = p.get_authemail();\n"},{"id":"86207","messageId":"20080804155751.GA15749@diana.vm.bytemark.co.uk","threadId":"14775","inReplyTo":"20080804151913.4269.74254.stgit@dawn.rfc1149.net","subject":"Re: [StGIT v2 PATCH] Do not mess-up with commit message formatting when sending email","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-08-04T15:57:51Z","receivedAt":"2008-08-04T15:57:51Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"Your round-trip time was shorter than mine by a few orders of\nmagnitude. ;-)\n\nOn 2008-08-04 17:19:14 +0200, Samuel Tardieu wrote:\n\n> The long description gets its trailing blanks removed as well as any\n> leading empty lines. Leading blanks are left untouched to preserve\n> the formatting.\n\nThanks, much better. Will apply.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"86293","messageId":"b0943d9e0808051348x7130f26cy4a233ea35ee9a5d0@mail.gmail.com","threadId":"14775","inReplyTo":"20080804151913.4269.74254.stgit@dawn.rfc1149.net","subject":"Re: [StGIT v2 PATCH] Do not mess-up with commit message formatting when sending email","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2008-08-05T20:48:27Z","receivedAt":"2008-08-05T20:48:27Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"2008/8/4 Samuel Tardieu <sam@rfc1149.net>:\n> The short description, which will be used as the email subject,\n> gets its leading and trailing blanks removed.\n>\n> The long description gets its trailing blanks removed as well\n> as any leading empty lines. Leading blanks are left untouched\n> to preserve the formatting.\n\nThanks.\n\n-- \nCatalin\n"}]}