mhagger/git-multimail — pull request #52 by newren (2014-05-28 22:11:07+00:00)
Title: Email for subset of refs -- with careful handling of the logic for detection of 'new' commits

There are many reasons folks might want to only have emails sent out for a subset of the refs in the repository:

1) A common workflow for folks is to have code reviews occur by pushing to a special branch (e.g. refs/heads/feature/X) or reference (refs/changes/NN/NNNNN/N). The code reviews are then handled via webby-tools (Atlassian Stash, Gerrit, etc.), not via email. Folks in general will already be pinged for the relevant code reviews, and they don't want extra emails about them, nor do they want emails about unofficial changes from other folks. So, providing a way to have git-multimail only send emails about a relevant subset of the repository is useful.

2) Another common workflow for people working on not-official-stuff is to push to locations such as refs/sandbox/$USER/$BRANCH. While people could pull directly from each other, many seem to like the workflow of pushing to a special place in the central/official repository. However, as this stuff is considered personal sandbox stuff, it makes no sense to broadcast emails about it.

3) Even if it weren't for these special workflows, the refs/notes/ hierarchy are somewhat of an implementational detail which users never look at directly. Emailing about updates to these refs is simply confusing.

4) Finally, various git servers may have implementation reasons for storing other special refs (e.g. refs/cache-automerge/* in Gerrit) under various circumstances, and these changes should not be sent to users either.

Because of all these reasons, it is very valuable to provide ways for users to mark a subset of refs as relevant, via either an exclusion or inclusion regex. The thing to be careful about is that emails for revisions do go out once those revisions become included in the 'official' part of the repository.

(I originally developed this in a couple stages in order to generalize it more as more was needed. If squashing some of these commits together makes more sense to you, just let me know.)