You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Daan Hoogland <da...@gmail.com> on 2014/03/13 22:56:41 UTC

review request hook for git

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

Re: review request hook for git

Posted by Mike Tutkowski <mi...@solidfire.com>.
Thanks, Daan!

I somehow missed this e-mail, so just read it now.


On Fri, Mar 14, 2014 at 4:24 PM, Daan Hoogland <da...@gmail.com>wrote:

> 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 <da...@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
>



-- 
*Mike Tutkowski*
*Senior CloudStack Developer, SolidFire Inc.*
e: mike.tutkowski@solidfire.com
o: 303.746.7302
Advancing the way the world uses the
cloud<http://solidfire.com/solution/overview/?video=play>
*(tm)*

Re: review request hook for git

Posted by Daan Hoogland <da...@gmail.com>.
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 <da...@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