nojhan/liquidprompt — pull request #245 by alexprengere (2013-12-07 15:58:37+00:00)
Title: Put the old behavior back into git lines count

Prior to some (recent) changes in the git status information
in the liquidprompt (see da940677ee and 0c1e66d12a), we had
the following behavior:
- the line count, e.g. (+2,-1) was a mere summary of a `git diff`.
Here is it very important to understand that staged changes do *not*
appear here by default, you have to perform `git diff HEAD` or
`git diff --staged` to see them
- the branch color was
- red if there were uncommitted changes (even in the staging area)
- yellow if some commits are not pushed, and if we were not in the
previous case
- green otherwise

With da940677ee, we use `git diff --shortstat HEAD` to compute the line
count, which gives different results if some changes have been *staged*.
I see two drawbacks of this approach:
- it reduces the amount of information available, since the staging area
is ignored (the same line count will appear if some changes are staged or not).
- users of `git diff` may be confused about this line count, since this it is
not the "usual" meaning of `git diff`.
With the old behavior, I got used to the fact that a line count of
(+0,-0) meant that all changes were staged for example, but since the
branch was red, the changes were not committed.

The `git diff --shorstat HEAD` is still a valid way to detect
uncommitted changes, but we have to perform another git command to have
a line count with the old behavior.