git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[StGIT v2 PATCH] Do not mess-up with commit message formatting when sending email

From
Samuel Tardieu <sam@rfc1149.net>
Date
Aug 4, 2008, 15:19 UTC
Message-ID
<20080804151913.4269.74254.stgit@dawn.rfc1149.net>
In-Reply-To
<20080804141640.GB12232@diana.vm.bytemark.co.uk>

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 <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..61e3f3a 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();
Previous: Karl HasselströmNext: Karl Hasselström
Message 3 of 5 in “Do not mess-up with commit message formatting when sending email”
  1. Do not mess-up with commit message formatting when sending emailSamuel Tardieu, Jul 31, 2008
  2. Karl HasselströmAug 4, 2008
  3. Do not mess-up with commit message formatting when sending emailSamuel Tardieu, Aug 4, 2008
  4. Karl HasselströmAug 4, 2008
  5. Catalin MarinasAug 5, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.