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

[PATCH Cogito] Remove heading and trailing empty lines from commit messages

From
MHMarcel Holtmann <marcel@holtmann.org>
Date
May 12, 2005, 20:44 UTC
Message-ID
<1115930670.18499.64.camel@pegasus>
Hi Petr,

the attached patch removes heading and trailing empty lines from the commit message before doing the commit.

Regards
Marcel
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Index: cg-commit
===================================================================
--- 00b94eea5b99d5dd1d1bbe9c9ca3502d11aec581/cg-commit  (mode:100755)
+++ uncommitted/cg-commit  (mode:100755)
@@ -134,7 +134,7 @@
 else
 	cat >>$LOGMSG2
 fi
-grep -v ^CG: $LOGMSG2 >$LOGMSG
+grep -v ^CG: $LOGMSG2 | sed '/./,${/./b;:a;$d;N;/\n$/ba;b;};d' >$LOGMSG
 rm $LOGMSG2
 
 
Message 1 of 1 in “Remove heading and trailing empty lines from commit messages”
  1. Remove heading and trailing empty lines from commit messagesMarcel Holtmann, May 12, 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.