git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* send an email with logs after push
@ 2009-11-13  8:46 michele
  2009-11-13  8:55 ` Pascal Obry
  0 siblings, 1 reply; 4+ messages in thread
From: michele @ 2009-11-13  8:46 UTC (permalink / raw)
  To: git

Hi guys, I'm using git for a collaborative development and I'm trying to
implement a notification system. I want to automatically send an email
containing the log of each commit after a push. The email should contain
the titles of the commits done between the previous and the last push.
The push action publish the repository on a public_html directory in one
other machine.

Do you have any suggestion to implement this?

Thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: send an email with logs after push
  2009-11-13  8:46 send an email with logs after push michele
@ 2009-11-13  8:55 ` Pascal Obry
  2009-11-13 10:42   ` Matthieu Moy
  0 siblings, 1 reply; 4+ messages in thread
From: Pascal Obry @ 2009-11-13  8:55 UTC (permalink / raw)
  To: michele; +Cc: git

Michele,

> Do you have any suggestion to implement this?

I'm doing that. In the post-receive hook I have:

<<
while read oldrev newrev ref; do
    trac_post_receive_record_log "$oldrev" "$newrev" "$ref" gtest

    send_mail_post_receive "$oldrev" "$newrev" "$ref" gtest \
	pascal@obry.net another@here.com
done
>>

the trac_post_receive_record_log is to add log into trac bug tracker.

the send_mail_post_receive is to send a message to the recipients
listed. The 4th parameter is the name of the project.

The send_mail_post_receive function is:

function send_mail_post_receive() {
    oldrev=$1
    newrev=$2
    ref=$3
    MODULE="$4"

    git log -p $oldrev..$newrev > $log
    cat $log | mail -s "[$MODULE] $ref $oldrev..$newrev" $5 $6 $7 $8 $9
    rm -fr $root
}

You'll find a set of hook helper routines there:

   git clone http://repo.or.cz/r/git-scripts.git

Hope this helps!

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: send an email with logs after push
  2009-11-13  8:55 ` Pascal Obry
@ 2009-11-13 10:42   ` Matthieu Moy
  2009-11-13 14:18     ` michele
  0 siblings, 1 reply; 4+ messages in thread
From: Matthieu Moy @ 2009-11-13 10:42 UTC (permalink / raw)
  To: Pascal Obry; +Cc: michele, git

Pascal Obry <pascal@obry.net> writes:

> Michele,
>
>> Do you have any suggestion to implement this?
>
> I'm doing that. In the post-receive hook I have:

See also post-receive-email in git/contrib/hooks/, probably installed
somewhere like by your distro. In the .git/hooks/post-receive.sample
installed by default by "git init", this should be a matter of
uncommenting one line.

--
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: send an email with logs after push
  2009-11-13 10:42   ` Matthieu Moy
@ 2009-11-13 14:18     ` michele
  0 siblings, 0 replies; 4+ messages in thread
From: michele @ 2009-11-13 14:18 UTC (permalink / raw)
  To: git

On Fri, 13 Nov 2009 11:42 +0100, "Matthieu Moy"
<Matthieu.Moy@grenoble-inp.fr> wrote:

> See also post-receive-email in git/contrib/hooks/, probably installed

Thank you for your suggestions. I've added a new post-receive hook using
the code from post-receive-email. The hook is executable and is placed
in the remote directory. The push is made from my local pc via ssh, but
after the push nothing seems to happen: the hook is not executed on the
server side. It does not depend from the code inside the hook: even the
unique "touch foobar" command does not work. Where do I have to look?

Thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-11-13 14:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-13  8:46 send an email with logs after push michele
2009-11-13  8:55 ` Pascal Obry
2009-11-13 10:42   ` Matthieu Moy
2009-11-13 14:18     ` michele

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).