commit-msg-url-shortener
Shortens the urls that may appear in your commit message (and more fun stuff)
Install it
$ gem install commit-msg-url-shortener
Use it
Move to a git-controlled folder and type the command commit-msg-url-shortener to show the help page. Available commands are:
$ commit-msg-url-shortener use [service]
$ commit-msg-url-shortener remove
$ commit-msg-url-shortener status
Example:
$ commit-msg-url-shortener use tinyurl.com
> Using "tinyurl.com".
$ git commit -m "fixes a security flow, see http://railspikes.com/2008/9/22/is-your-rails-application-safe-from-mass-assignment"
> [master d0adf01] fixes a security flow, see http://tinyurl.com/2g9mqh
1 files changed, 10 insertions(+), 9 deletions(-)
Hack it
Fork it, and add support for new url-shortener sites. You can also create your own service that pre-process commit messages! For example you can create a must-have service that automatically translate your commit message into leetspeak:
- Create a new file called leetspeak.rb in the services folder
Fill the leetspeak.rb file with the following code:
CommitMsgUrlShortener::Service.define do || translation = {:a=>4,:b=>8,:e=>3,:i=>'!', :k=>:X,:l=>1,:o=>0,:s=>7,:t=>7,:z=>2} = '' .each_char do |c| t = translation[c.downcase.to_sym] += t ? t.to_s : c end endRebuild/reinstall the gem:
$ bundle exec rake installNow you can use your brand new service! Move to your super-secret-git-versioned-project and type:
$ commit-msg-url-shortener use leetspeak > Using "leetspeak". $ git commit -am "initial commit!" > [master d0adf00] !n!7!41 c0mm!7! 1 files changed, 4 insertions(+), 4 deletions(-)