git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [StGIT PATCH] Do not mess-up with commit message formatting when sending email
@ 2008-07-31 12:50 Samuel Tardieu
  2008-08-04 14:16 ` Karl Hasselström
  0 siblings, 1 reply; 5+ messages in thread
From: Samuel Tardieu @ 2008-07-31 12:50 UTC (permalink / raw)
  To: git; +Cc: Catalin Marinas

The short description, which will be used as the email subject,
gets its leading and trailing whitespaces removed.

The long description only gets its trailing whitespaces removed
to preserve commit message formatting, e.g. in the case of a
ChangeLog-style commit message, as well as empty leading lines.

Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
---
 stgit/commands/mail.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py
index a833efc..bdc3fcc 100644
--- a/stgit/commands/mail.py
+++ b/stgit/commands/mail.py
@@ -401,8 +401,8 @@ def __build_message(tmpl, patch, patch_nr, total_nr, msg_id, ref_id, options):
         options.edit_patches = True
 
     descr_lines = descr.split('\n')
-    short_descr = descr_lines[0].rstrip()
-    long_descr = '\n'.join(descr_lines[1:]).lstrip()
+    short_descr = descr_lines[0].strip()
+    long_descr = '\n'.join([l.rstrip() for l in descr_lines[1:]]).lstrip('\n')
 
     authname = p.get_authname();
     authemail = p.get_authemail();

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-08-05 20:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-31 12:50 [StGIT PATCH] Do not mess-up with commit message formatting when sending email Samuel Tardieu
2008-08-04 14:16 ` Karl Hasselström
2008-08-04 15:19   ` [StGIT v2 " Samuel Tardieu
2008-08-04 15:57     ` Karl Hasselström
2008-08-05 20:48     ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).