anybody gave it apin?

just put it in your local .git/hooks/prepare-commit-msg and it should
do its job. It's job is to do nothing if you don't add or update any
files that end with .sql and to add the tag [DB-CHANGE] to the commit
message if you do.

I would like some feedback before I apply. Like is .sql the only
pattern? Or should I include *VO.java or *DaoImpl.java? (maybe later)

Also some test runs to see if quirks pop up would be nice.

regards,
Daan

On Thu, Mar 13, 2014 at 10:56 PM, Daan Hoogland <daan.hoogl...@gmail.com> wrote:
> H,
>
> I concocted a git prepare-commit-msg hook.
>
> Please rant about my evening hobby after testing and reading
>
> <script>
> DB=`git status | grep -e "modified.*\.sql$" -e "new file.*\.sql$"`
> OLD_MSG=`cat $1`
> if [ -z "$DB" ]
> then
>   MSG="[DB-CHANGE] $OLD_MSG"
> else
>   MSG="$OLD_MSG"
> fi
> echo "$MSG" >$1
> </script>
>
> regards,
> --
> Daan



-- 
Daan

Reply via email to