upgrade parse_git_dirty and fix PS1
few new tricks thanks to @kevinsawicki