Re: Template for commit messages

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Template for commit messages
Date: 2016-01-29 09:41:15
Message-ID: 20160129094115.GC2851@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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(at)momjian(dot)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 +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2016-01-29 09:42:08 Re: Template for commit messages
Previous Message Artur Zakirov 2016-01-29 09:10:00 Re: Fuzzy substring searching with the pg_trgm extension