From 42857cbe036ba5917eacc9dbb5644d395f638ed9 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Mon, 4 Aug 2008 17:36:32 +0200 Subject: [PATCH] Do not mess-up with commit message formatting when sending email MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The short description, which will be used as the email subject, gets its leading and trailing blanks removed. The long description gets its trailing blanks removed as well as any leading empty lines. Leading blanks are left untouched to preserve the formatting. Signed-off-by: Samuel Tardieu Signed-off-by: Karl Hasselström --- stgit/commands/mail.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py index b4d4e18..031444d 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(); -- 2.11.0