make parse_git_dirty more generic