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.
>>> ...
>> Hmmph.
>> 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
> settings.

Would that help anybody, though?

A user who does not notice the _lack_ of mention of the current
branch in the feedback from "git push" would not notice the lack of
"ahead, behind or the same".

We could contemplate on saying "your current branch is not set to be
pushed out to anywhere" instead of being silent in the case where
the output with your patch is silent, but that would make "status"
output irritatingly chatty when you are on a private topic branch
that you never intend to push out except as a part of an integration
branch after merging into it, so it is not a good solution either,
but at least that would solve the original problem.

Isn't it the real solution to the original poster's problem to make
"git push" explain "Everything is up to date, and nothing is pushed"
case better?

Perhaps "git push" can learn an option to show what the command
would push out if there were something to push.  If push.default is
set to matching and the user is on a branch that does not exist on
the receiving end, matching branches will be listed as "up to date"
and the user could notice that his current branch is _not_ among the
ones that are listed.  When there is _no_ branch to be pushed out
(e.g. there is no matching branches, or you are on a detached HEAD)
that "please explain" option could really explain whey there is no
branch to be pushed out".

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

Reply via email to