jenkinsci/git-plugin — pull request #56 by lmarlow (2012-03-06 07:27:18+00:00)
Title: Teach GitStatus to handle notifications of specific branches

A comma delimited list of affected branches can be sent to the
notifyCommit endpoint now. Only the builds that match those branches
will be triggered. If no branch parameter is sent then any build that
matches the repository URL will be triggered.

`http://yourserver/jenkins/git/notifyCommit?url=aUrl&branches=master,topic`

The url can be hit from the post-update hook with a script like the following:

```
#!/bin/sh
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, rename this file to "post-update".

echo Update pushed to repo
branch_list=""
delim=""

for ref in $@; do
branch="$(git rev-parse --symbolic --abbrev-ref $ref)"
branch_list=${branch_list}${delim}${branch}
delim=","
done
curl "http://yourserver/jenkins/git/notifyCommit?url=aUrl&branches=${branch_list}" 2>/dev/null
```