How to git commit nothing without an error?
From the git commit
man page:
--allow-empty Usually recording a commit that has the exact same tree as its sole parent commit is a mistake, and the command prevents you from making such a commit. This option bypassesthe safety, and is primarily for use by foreign SCM interface scripts.
with settings(warn_only=True): run('git commit ...')
This causes fabric to ignore the failure. Has the advantage of not creating empty commits.
You can wrap it in a additional layer of with hide('warnings'):
to totally suppress output, otherwise you'll get a note in the fabric output that the commit failed (but the fabfile continues to execute).