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

Re: [PATCH] format-patch: fix skipping of blank-lines

From
Linus Torvalds <torvalds@osdl.org>
Date
Jul 9, 2005, 01:42 UTC
Message-ID
<Pine.LNX.4.58.0507081838560.17536@g5.osdl.org>
In-Reply-To
<7vu0j44xi4.fsf@assigned-by-dhcp.cox.net>
On Fri, 8 Jul 2005, Junio C Hamano wrote:
>
> If it is fed a commit with more than one leading blank lines,
> the sed scripts git-format-patch-script used looped forever.
> This patch fixes it.

How about using "git-stripspace"? That's what it's there for. It strips whitespace from the end of lines, from the beginning, and from the end. It also removes multiple consecutive whitespace lines from within the body of the message - which might turn some people off, but I use that same thing when I do my automated email commits, so if you don't strip those lines from the email, they _will_ get stripped at commit time, so..

"git-stripspace" also doesn't get confused by non-empty lines that have spaces in them, like your script seems to be (ie /^$/ won't match a line that has a space on it).

		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 3 in “format-patch: fix skipping of blank-lines”
  1. format-patch: fix skipping of blank-linesJunio C Hamano, Jul 9, 2005
  2. Linus TorvaldsJul 9, 2005
  3. format-patch: fix skipping of blank-lines (take 2)Junio C Hamano, Jul 9, 2005

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.