git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pascal Obry <pascal@obry.net>
To: michele <michele@mailc.net>
Cc: git@vger.kernel.org
Subject: Re: send an email with logs after push
Date: Fri, 13 Nov 2009 09:55:38 +0100	[thread overview]
Message-ID: <a2633edd0911130055y199955a2n93888b03c5f9b985@mail.gmail.com> (raw)
In-Reply-To: <1258101999.17624.1345023113@webmail.messagingengine.com>

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

  reply	other threads:[~2009-11-13  8:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-13  8:46 send an email with logs after push michele
2009-11-13  8:55 ` Pascal Obry [this message]
2009-11-13 10:42   ` Matthieu Moy
2009-11-13 14:18     ` michele

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a2633edd0911130055y199955a2n93888b03c5f9b985@mail.gmail.com \
    --to=pascal@obry.net \
    --cc=git@vger.kernel.org \
    --cc=michele@mailc.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).