lad1337/XDM — pull request #49 by mjc (2013-08-28 21:18:02+00:00)
Title: Use git porcelain for git commands where applicable

- Use ``` git symbolic-ref --short --quiet HEAD``` to get the name of the current branch to avoid parsing text and dealing with colors.
- Use ``` git rev-parse --verify --quiet @{upstream}``` to get the remote tracking branch.
- Use ``` git status --porcelain``` to get the list of changed files for dirty check.
- Use ``` git rev-list --left-right --count @{upstream}...HEAD``` (note the triple-dots instead of double-dots) to get behind/ahead counts, and thus avoid regexp parsing.