gr icon indicating copy to clipboard operation
gr copied to clipboard

Really missing the `@modified` type functionality mentioned in the README

Open rocketraman opened this issue 6 years ago • 2 comments

What a great project. Super-useful. However, I'm really wishing the @modified functionality mentioned in the README was available -- one almost always wants to do stuff in just projects with changes. I see that there has really been no activity on this project for a while, but do you have any plans to keep improving this project?

rocketraman avatar Sep 19 '18 14:09 rocketraman

For now, I'm working around this with a hack. I created a script called ifgitmodified with this content:

#!/bin/bash                                                                                                                                                                                                                        
if [[ $(git status --porcelain) ]]; then                                                                                                                                                                                           
  $@                                                                                                                                                                                                                               
fi

and now I can do:

gr @whatever ifgitmodified <any command and args here>

I also have similar scripts ifgitahead, ifgitbehind, and ifgitbranch.

rocketraman avatar Oct 16 '18 04:10 rocketraman

All these scripts uploaded to https://github.com/rocketraman/grscripts in case anyone else finds them useful.

rocketraman avatar Oct 16 '18 05:10 rocketraman