Ruby commit hook 
Features
On each commit of Ruby's Git repository, following git hooks are triggered:
pre-receive
- Verify committer email from
SVN_ACCOUNT_NAMEassociated to SSH key used forgit push - Reject merge commits (ask @mame about why)
post-receive
- Send notification to ruby-cvs@ruby-lang.org
- Commit automatic styling:
- remove trailing spaces
- append newline at EOF
- expand tabs
- Update version.h if date is changed
- Request Redmine to fetch changesets
- Mirror cgit to GitHub
- Notify committer's Slack
The directory structure of git.ruby-lang.org
/data/svn/repos/ruby: SVN repository of Rubyhooks/post-commit: Run/home/git/ruby-commit-hook/hooks/post-commit.sh
/data/git/ruby.git: Bare Git repository of rubyhooks/post-receive: Run/home/git/ruby-commit-hook/hooks/post-receive.sh
/home/git/ruby-commit-hook: Cloned Git repository of ruby-commit-hook
Notes
- There's a symlink
/var/git->/data/git. - User
git's$HOMEis NOT/home/gitbut/var/git.
How to deploy ruby-commit-hook
bin, cgi-bin, hooks
git pushto ruby-commit-hook's master branch automatically updates them.- ruby-commit-hook push webhook triggers
cgi-bin/webhook.cgi - It runs
sudo -u git bin/update-ruby-commit-hook.sh
- ruby-commit-hook push webhook triggers
sites-available
Note: git.ruby-lang.org.conf (in /etc/apache2/sites-available) is managed
in this repository.
To apply apache2 config changes, once the webhook finishes, run:
sudo /etc/init.d/apache2 reload