GitFix
Gist:
Simple git-snippet to commit a small fix with auto-generated commit-message.
Description
I noticed, we developers often needs to fix a small typo or do something similiar. And I noticed a lot of Devs, will create awful, or no commit-message at all for these little changes.
So, this little script here, will automatically add files to your index, shows you the generated commit-message and commit if you are fine.
Or you just abort, because you got a idea of a great message!
Usage
git-fix
Installation
Save file to ~/bin/git-fix (may chmod +X it)
Or run:
curl -L "https://gist.github.com/Deradon/4735318/raw/cbf43d10e0f8db8b2ec4d45ddea2ea23c3a50561/git_fix.rb" > ~/bin/git-fix && chmod u+x ~/bin/git-fix
Example
$ git-fix
> git commit -m 'Fixes: Gemfile, Gemfile.lock
Other files:
* application_tab_edit_810.css.scss
* errbit.rb
* item_wrapper.rb
* manager_app_helper.rb
* package.rb
* routes.rb
* schema.rb
* tab_app.rb
* tabs_controller.rb'
Written by Patrick Helm
Related protips
6 Responses
Hmmm... it seems that your grep is not working!
@haihappen Wow, ok, I'll have a look at. May you post a sample git status
, for that grep does not work the way it should do?
Maybe it's because of the colors: https://www.evernote.com/shard/s42/sh/51e9ac22-253e-4639-99cf-5aae0c16713d/ef3442860c87fc409cf8bf0716474185
Ah, great. Maybe I should do the RegEx stuff with Ruby, instead of command-line calls.
@deradon Yap, would make more sense because the rest is already done in Ruby :)