Re: send an email with logs after push

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Pascal Obry
Date: Friday, November 13, 2009 - 1:55 am

Michele,


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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
send an email with logs after push, michele, (Fri Nov 13, 1:46 am)
Re: send an email with logs after push, Pascal Obry, (Fri Nov 13, 1:55 am)
Re: send an email with logs after push, Matthieu Moy, (Fri Nov 13, 3:42 am)
Re: send an email with logs after push, michele, (Fri Nov 13, 7:18 am)