threads / patch / 589

patchRemove heading and trailing empty lines from commit messages

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

## tl;dr

One message between May 12, 2005 and May 12, 2005. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Marcel Holtmann· May 12, 2005, 20:44 UTC · lore
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>
Show changes to diff +1 −1
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
 
 

← back to recent threads