Minority Opinions

Not everyone can be mainstream, after all.

Magic Git Commit

leave a comment »

I’ve finally implemented a magic `git ci` command to resolve my most serious complaint with the version control system I use most.  Now I just have to train myself to use the new `git df` command instead of diff.

It’s not perfect yet, by any means.  Using any diff parameter other than file and directory names is likely to break the internalstatus check, because it tries to auto-commit only those items.  There are multiple potential error conditions that aren’t caught, including the possibility of a non-json cache file.

I’m also less than thrilled by the third-party dependency, even if it’s just one package and one module.  I used plumbum partly for the convenience and partly to try it out; it really is a nice way to call external programs.  However, it’s currently living in my ~/bin directory, because it might be called from within any virtual environment.  I should probably move the main python script to its own directory, calling it with a pair of stubs; that would also remove the need for a name check, which always feels a bit hackish.

But this is something I’ve been meaning to do for a very long time, so I’m happy that it’s actually in progress.  My nosetest completion and git-cat scripts have improved with use, and I’m certain the same will happen here.  Then again, my next trick might be to rework git-dot with a NetworkX back end.

Advertisements

Written by eswald

18 Dec 2012 at 5:48 pm

Posted in Linux, Technology

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s