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

1 messages from 2005-05-12 to 2005-05-12. Participants: Marcel Holtmann.
Thread: https://gitlist.dev/t/589

## Marcel Holtmann, 2005-05-12 20:44

Subject: [PATCH Cogito] Remove heading and trailing empty lines from commit messages
Message-ID: <1115930670.18499.64.camel@pegasus>
URL: https://gitlist.dev/e/1115930670.18499.64.camel%40pegasus

```
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
 
 

```
