Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git email hook to include commit message and changed files

I set up the email hook for git in heroku. However, all i get is the message that something is pushed - i need both the commit message and the modified files.

#what i now get in the email:
[email protected] to me, hermantamas

[email protected] deployed app

#what i need:
[email protected] to me, hermantamas

[email protected] deployed app:

"home page is now working"
Changed:
- index.html
- javascript.js
like image 855
meow Avatar asked Dec 10 '10 05:12

meow


People also ask

Can git hooks be committed?

It's important to note that Git hooks aren't committed to a Git repository themselves. They're local, untracked files.

What is a commit-msg hook?

The commit-msg hook is much like the prepare-commit-msg hook, but it's called after the user enters a commit message. This is an appropriate place to warn developers that their message doesn't adhere to your team's standards. The only argument passed to this hook is the name of the file that contains the message.


1 Answers

That would mean modifying the Heorku email hook directly to add some of those git log options (git log --name-status, git log --name-only, git log --stat or git whatchanged)

But since you may not have the possibility to change directly the hook script, you still can add one Heroku variable when defining said mail hook.

git_log: log of commits between this deploy and the last

$ heroku addons:add deployhooks:email \
    [email protected] \
    subject="Myapp Deployed" \
    body="{{user}} deployed app: {{git_log}}"
Adding deployhooks:email to myapp...Done.
like image 75
VonC Avatar answered Sep 28 '22 03:09

VonC