threads / discuss / 8086

how to set up e-mail notification?

Subject: how to set up e-mail notification?

## tl;dr

3 messages between May 11, 2007 and May 12, 2007.

replies: 2people: 2as markdown or json

Oliver Kullmann· May 11, 2007, 19:55 UTC · lore
Hello,

I have set up a Git repository as a shared repository as described in the CVS-to-Git conversion manual.

Now I want this shared Git repository to send out notification e-mails after commits, simulating what with CVS was achieved by adding to CVSROOT/loginfo the lines

--------------------- # CVS notifications to all users on commit ALL (echo ""; echo %{sVv}; date; cat) | mutt -s "OKlibrary CVS Commit -- $USER" e-mail-address_1 e-mail-address_2 ---------------------

Now I understand that I shall make
hooks/post-commit

executable, and then fill the file with some script which will send the e-mails: But apparently this script does not have any parameters, that is, no information is supplied to it?

So the idea is to write some program which reads the last commit and extracts the information from the git-repository, and sends the e-mail?

Now I would guess many others have already solved that task, and so I would be glad it they could tell me such a little script (standard Linux environment).

Thanks in any case!
Oliver
Julian Phillips· May 12, 2007, 01:35 UTC · re: Oliver Kullmann · lore

Re: how to set up e-mail notification?

On Fri, 11 May 2007, Oliver Kullmann wrote:
Show 8 quoted lines
> Hello,
>
> I have set up a Git repository as a shared repository as described in
> the CVS-to-Git conversion manual.
>
> Now I want this shared Git repository to send out notification e-mails
> after commits, simulating what with CVS was achieved by
> adding to CVSROOT/loginfo the lines
...
> Now I would guess many others have already solved that task, and so I would
> be glad it they could tell me such a little script (standard Linux environment).

There's one in the standard git source tree: contrib/hooks/post-receive-email

never used it myself ...
-- 
Julian

  ---
Zoe: "Are those grenades?"

Jayne: "Cap'n doesn't want 'em."

Zoe: "We're robbing the place.  We're not occupying it."
Oliver Kullmann· May 12, 2007, 20:11 UTC · re: Julian Phillips · lore

Re: how to set up e-mail notification?

Show 6 quoted lines
> 
> There's one in the standard git source tree: 
> contrib/hooks/post-receive-email
> 
> never used it myself ...
> 

Thanks! That script looks quite complicated, so as a quick solution I just added to hooks/post-receive the line

mutt -s "Git push Repository-Name -- $USER" e-mail-addresses

so that at least the users see that something happened, and I'll investigate contrib/hooks/post-receive-email.

Oliver

← back to recent threads