git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: send an email with logs after push

From
Pascal Obry <pascal@obry.net>
Date
Nov 13, 2009, 08:55 UTC
Message-ID
<a2633edd0911130055y199955a2n93888b03c5f9b985@mail.gmail.com>
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
Previous: micheleNext: Matthieu Moy
Message 2 of 4 in “send an email with logs after push”
  1. micheleNov 13, 2009
  2. Pascal ObryNov 13, 2009
  3. Matthieu MoyNov 13, 2009
  4. micheleNov 13, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.