arialdomartini / oh-my-git

An opinionated git prompt for bash and zsh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

switch (branch name | origin) in status display

robkorv opened this issue · comments

the status displays branch name followed by remote, while the git command follows remote/branch name. It would be more consistent to also follow this.

screenshot from 2015-05-13 14 15 29

Agree 👍 It would be nice.

The status displays local branch and after that remote branch like this <loc-branch>  <remote>/<rem-branch> but only when and has the same name isn't repeated due to a shortened output. This behavior is correct because (in your case master) isn't remote branch (remote branch is the second one - origin/master) and switching positions could swap that in your minds.
The actual output actually mean: local branch master is tracking ( ) remote branch on origin with the same name.

Good point @pdostal @robkorv !
I wonder if swapping them could be confusing, since like @Sgiath claims, the meaning is not

you are on origin/master

but
you are on master, that tracks origin/[master]

I understand @pdostal and @robkorv suggest to swap the elements. What would you do @Sgiath ?

I like it as it is right now and I see logic in that. I thought that this "enhancement" was suggested because of misunderstanding actual situation so I want to correct that.
Maybe solution is don't shortened the name of remote branch in case of the same name but I think it isn't necessary. I just simply love it as it is.

Now I also see the logic behind it, tnx @Sgiath.

I suggest to keep the logic as it is. An usability improvement would be, to not shorten remote/trackingbranch when on the same branch.

I started this issue because when I wanted to do a reset of a local branch on the remote branch with the same name. I started typing git reset branchname/remote instead of git reset remote/branchname. I unconsciously mimicked the nice and clear oh-my-git status line 😎