On Thu, Jan 28, 2016 at 03:16:18PM -0500, Stephen Frost wrote:
> > OK, but keep in mind whatever script committers user should remove tags
> > that are empty after exiting the editor. I can provide the grep regex
> > in git somewhere too:
> >
> > egrep -v "^(Author|Reported-by|Bug|Reviewed-by|Tested-by|Backpatch-through): *$"
>
> If the template is there then, for my part at least, I wouldn't mind
> killing the empty lines. Having a decent script would work too, of
> course... but I have to admit that I've not tried having a script modify
> my commit messages right before they're committed and, well, it'd take a
> bit for me to be comfortable with it.
>
> No one wants garbled commit messages from a script that went awry. ;)
I have always used a script. This removes trailing blank lines:
sed -e :a -e '/./,$!d;/^\n*$/{$d;N;};/\n$/ba'
and this removes adjacent blank lines:
cat --squeeze-blank
I can publish my script at the appropriate time.
-- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB
http://enterprisedb.com
+ As you are, so once was I. As I am, so you will be. +
+ Roman grave inscription +