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

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

From
Karl Hasselström <kha@treskal.com>
Date
Aug 4, 2008, 14:16 UTC
Message-ID
<20080804141640.GB12232@diana.vm.bytemark.co.uk>
In-Reply-To
<20080731125005.894.10592.stgit@dawn.rfc1149.net>
On 2008-07-31 14:50:05 +0200, Samuel Tardieu wrote:
> The short description, which will be used as the email subject, gets
> its leading and trailing whitespaces removed.
OK, good.
> 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.

I'd like a better description of this change, please. If I'm not mistaken, we used to do _only_ left stripping of the body. You change that to left stripping of only newlines, but also add right stripping for each line. I'm all for these changes, but the commit message confused me a lot.

> -    long_descr = '\n'.join(descr_lines[1:]).lstrip()
> +    long_descr = '\n'.join([l.rstrip() for l in descr_lines[1:]]).lstrip('\n')

We require Python 2.4 or later, so you can skip the square brackets here.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Previous: Samuel TardieuNext: Samuel Tardieu
Message 2 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.