Skip to content

Instantly share code, notes, and snippets.

View guyc's full-sized avatar

Guy Carpenter guyc

  • Clearwater Software
  • Australia
View GitHub Profile
@guyc
guyc / prepare-commit-msg.rb
Created April 5, 2011 03:09
git hook to add the first subdirectory name in the repo to the commit message.
#!/usr/bin/ruby
#
# Save this file as GITDIR/.git/hooks/prepare-commit-msg
# where GITDIR is the top directory of your git repository.
# then chmod +x prepare-commit-msg
#
# This hook is invoked by 'git-commit' right after preparing the default log
# message, and before the editor is started.
#
# It takes one to three parameters. The first is the name of the file that the commit