From: Francis Moreau Date: Sat, 24 Mar 2007 18:15:50 GMT Subject: Re: [PATCH] update-hook: remove all functionality that should be in hooks/post-receive Message-ID: <38b2ab8a0703241115q39dc298clb15357268288b49e@mail.gmail.com> In-Reply-To: <200703241548.13775.andyparkins@gmail.com> On 3/24/07, Andy Parkins wrote: > On Saturday 2007, March 24, Francis Moreau wrote: > > > Are there any simple ways to enable this behaviour from your hooks ? > > Yes; have a look near the bottom of the post receive hook (update to > come today, so don't use it yet), but you'll see: > > while read oldrev newrev refname > do > generate_email $oldrev $newrev $refname | /usr/sbin/sendmail -t > done > > That pipe to send mail could be anything you want, say > > generate_email >> /var/www/update-announcements.txt > > Would that suit you? > yes that almost would do the thing. But instead of hacking the hook, it would be great to have a trivial setup at the begining of the script to choose this config. Maybe a local config in the repo through the command `git config` could do the job ? $ git config hook.update.path "/var/www/" And if the config is to write the message to a file, skip the email stuffs generation (header, foorter...). thanks -- Francis