git-deploy/git-deploy — pull request #22 by ojacobson (2012-10-29 23:35:37+00:00)
Title: Invoke a stable 'git status' command to check for cleanliness.

Git 1.8.0 changed the format of 'git status' from

... (working directory clean)

to

..., working directory clean

This kind of harmless modification of prose output happens pretty regularly, and relying on the prose parts to determine the result of a Git command is pretty fragile.

Fortunately, Git folks are aware of this, and provide stable interfaces too. For `git status`, the programmatic interface is `git status --porcelain`, which has a stable (and much simpler) output format, with one line per non-clean file. Empty output indicates a clean tree.

I haven't spent a huge amount of effort finding other places this might bite; with this change git-deploy works (to the best of my testing, which isn't much) on Git 1.8.0.