Send email when changes to specific files are pushed...hook or new feature?

We are generating files listing third-party dependencies with our builds, then committing them. We want GitLab to send emails on pushes, with control over:

  • Which files we watch for changes (could be list or regex)
  • Which projects we watch (again, list or regex)
  • Who gets emailed

I’ve considered a number of approaches:

  • Web hooks will get triggered by pushes, but there doesn’t seem to be a way to control granularity
  • The same applies to emails on push and other services
  • Git hooks (placed in the custom_hooks directory) seem to be the most powerful way of doing this, but they are tricky to understand and maintain, and would have to sync with email

I would like to leverage GitLab-configured email; I started looking into how this is handled in the GitLab source, which started me thinking about extending GitLab itself, perhaps by adding some parameters to email on push. This would be pretty handy to have, and a nice thing to share, but I might not have the time to figure out everything needed to extend GitLab properly.

So what do people think would be the best approach? A simple hook script, possibly leveraging GitLab email? I’m pretty well versed in shell programming, but willing to figure out Ruby by looking at some examples.
Thanks for any input!