Re: [PATCH v3] status: always show tracking branch even no change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jiang Xin <worldhello.net@xxxxxxxxx> writes:

> If the current branch has an upstream branch, and there are changes
> between the current branch and its upstream, some commands (such as
> "git status", "git status -bs", and "git checkout") will report their
> relationship. E.g.
>
>     $ git status
>     # On branch master
>     # Your branch is ahead of 'origin/master' by 1 commit.
>     #   (use "git push" to publish your local commits)
>     #
>     ...
>
>     $ git status -bs
>     ## master...origin/master [ahead 1]
>     ...
>
>     $ git checkout master
>     Already on 'master'
>     Your branch is ahead of 'origin/master' by 1 commit.
>       (use "git push" to publish your local commits)
>
> But if there is no difference between the current branch and its
> upstream, the relationship will not be reported, and it's hard to
> tell whether the current branch has a tracking branch or not. And
> what's worse, when the 'push.default' config variable is set to
> `matching`, it's hard to tell whether the current branch has already
> been pushed out or not at all [1].

That description of the problem you are trying to solve makes (sort
of) sense.

> 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.
>
>     $ git status
>     # On branch master
>     # Your branch is identical to 'origin/master'.
>     #
>     ...
>
>     $ git status -bs
>     ## master...origin/master
>     ...

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).

"Your branch is identical to" will be given only if your branch is
set to be pushed out, no?  For the user to tell what is going on,
the user has to notice the lack of this extra line in the output,
and noticing the lack of anything is much unlikely.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]