Created by: alexprengere
Prior to some (recent) changes in the git status information in the liquidprompt (see da940677 and 0c1e66d1), 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 performgit diff HEAD
orgit 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 da940677, 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 ofgit 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.