I have the post-receive hook running with a configuration in gitolite that emails a group when any files change in a repo on a certain branch. Now, I have a request to setup email notification for a different "TO" when certain files change in the same repo. How do I set up multiple configs for the post-receive email hook? Also, how do I trigger a post-receive hook based on files that changed? I don't believe the hook has file info, right?
Asked
Active
Viewed 505 times
1 Answers
0
You will have to inspect git log --name-only oldrev..newrev
output to determine if any files that you are interested are changed.

user229044
- 232,980
- 40
- 330
- 338

Adam Dymitruk
- 124,556
- 26
- 146
- 141
-
ok, but how do I configure multiple recipients for different emails? – user561638 Nov 08 '11 at 03:31
-
There is a gitolite_user variable you can read. Check out the sample hook included in gitolite. – Adam Dymitruk Nov 09 '11 at 05:34
-
Thanks Adam, but I am not sure how that helps me? The TO I need to send to is an email alias, and there are 2 different lists depending on the branch and/or the files modified. – user561638 Nov 09 '11 at 20:29
-
Also, I tried your command git log ... in my post-receive hook, and it doesn't seem to give any results. Are you sure I can use a git command in a post-receive hook? – user561638 Nov 09 '11 at 20:30