Closed requested to merge github/fork/alexprengere/develop into develop
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 perform
git diff HEADor
git diff --stagedto 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 diffmay be confused about this line count, since this it is not the "usual" meaning of
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.
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.