2013/8/12 Junio C Hamano <gits...@pobox.com>:
> Jiang Xin <worldhello....@gmail.com> writes:
>> 2013/8/10 Junio C Hamano <gits...@pobox.com>:
>>> Jiang Xin <worldhello....@gmail.com> writes:
>>>> So always show the remote tracking branch in the output of "git status"
>>>> and other commands will help users to see where the current branch
>>>> will push to and pull from. E.g.
>>> I do not know if this will help any case you described above, even
>>> though this might help some other cases. The added output is to
>>> always show the current branch and its upstream, but the thing is,
>>> the original issue in $gmane/198703 was *not* that the current
>>> branch was pushed and up to date. It was that there was no current
>>> branch to be pushed. The same thing would happen if you are on a
>>> local branch that is not set to be pushed to the other side
>>> (e.g. the configuration is set to "matching" and there is no such
>>> branch on the other end).
>> How about write the commit log like this:
>> Then if there is no tracking info reported, the user may need to do
>> something. Maybe the current branch is a new branch that needs to be
>> pushed out, or maybe it's a branch which should add remote tracking
> Would that help anybody, though?
I will split the patch into two. The 1st patch resolves a real problem:
branch: not report invalid tracking branch
Command "git branch -vv" will report tracking branches, but invalid
tracking branches are also reported. This is because the function
stat_tracking_info() can not distinguish whether the upstream branch
does not exist, or nothing is changed between one branch and its
This patch changes the return value of function stat_tracking_info().
Only returns false when there is no tracking branch or the tracking
branch is invalid, otherwise true. If the caller does not like to
report tracking info when nothing changed between the branch and its
upstream, simply checks if num_theirs and num_ours are both 0.
And in the 2nd patch, I will not mention "git push" (current not be
pushed out ...) any more, and only focus on "git status". It's just
a suggestion, may only fit small group of users' taste.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html