Git电子邮件挂钩包含提交消息和更改的文件 [英] Git email hook to include commit message and changed files
问题描述
我在heroku中设置了git的电子邮件钩子。然而,我所得到的信息是推送的东西 - 我需要提交消息和修改的文件。
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:
noreply@heroku.com to me, hermantamas
xxx@gmail.com deployed app
#what i need:
noreply@heroku.com to me, hermantamas
xxx@gmail.com deployed app:
"home page is now working"
Changed:
- index.html
- javascript.js
推荐答案
直接添加一些 heorku电子邮件挂钩。这些git日志选项( git log --name-git-log-show-filenames-like-svn-log -v状态
, git log --name-only
, git log --stat
或 git whatchanged
)
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
)
但由于您可能无法直接更改挂钩脚本,因此您仍然可以添加一个 Heroku变量。
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 :此部署与最后
$ heroku addons:add deployhooks:email \
recipient=me@example.com \
subject="Myapp Deployed" \
body="{{user}} deployed app: {{git_log}}"
Adding deployhooks:email to myapp...Done.
这篇关于Git电子邮件挂钩包含提交消息和更改的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!