The goal is to get an unambiguous status that can be evaluated in a shell command.
I tried git status but it always returns 0, even if there are items
git status
Not pretty, but works:
git status | grep -qF 'working directory clean' || echo "DIRTY"
Not sure whether the message is locale dependent, so maybe put a LANG=C in front.
LANG=C