In a Makefile, I'd like to perform certain actions if there are uncommited changes (either in the working tree or the index). What's the cleanest and most efficient way to do that? A command that exits with a return value of zero in one case and non-zero in the other would suit my purposes.
I can run git status
and pipe the output through grep
, but I feel like there must be a better way.