Skip to content
Git hooks for ruby/ruby repository
Ruby Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
cgi-bin Fix typo of payload Aug 12, 2019
hooks Stop debugging env Aug 22, 2019
sites-available Increase NPROC a little Aug 12, 2019
test Improve test to avoid git clone Aug 20, 2019
.gitignore Move svn-utils to top-level Apr 21, 2019
.ruby-version Upgrade Ruby to 2.3 Aug 10, 2019
.travis.yml Change travis test to test-unit Aug 11, 2019
Gemfile Upgrade Ruby to 2.3 Aug 10, 2019
Gemfile.lock Forgot to bundle install Aug 10, 2019 Update README about deployment Aug 12, 2019
Rakefile Setup rake test and run it on Travis Aug 10, 2019

Ruby commit hook Build Status


On each commit of Ruby's Git repository, following git hooks are triggered:


  • Verify committer email from SVN_ACCOUNT_NAME associated to SSH key used for git push
  • Reject merge commits (ask @mame about why)


  • Send notification to
  • 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

  • /data/svn/repos/ruby: SVN repository of Ruby
    • hooks/post-commit: Run /home/git/ruby-commit-hook/hooks/
  • /data/git/ruby.git: Bare Git repository of ruby
    • hooks/post-receive: Run /home/git/ruby-commit-hook/hooks/
  • /home/git/ruby-commit-hook: Cloned Git repository of ruby-commit-hook


  • There's a symlink /var/git -> /data/git.
  • User git's $HOME is NOT /home/git but /var/git.

How to deploy ruby-commit-hook

bin, cgi-bin, hooks

  • git push to 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/


Note: is managed in this repository.

To apply apache2 config changes, once the webhook finishes, run:

sudo /etc/init.d/apache2 reload


Ruby License

You can’t perform that action at this time.