Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361029

Summary: [client][Status] Wrong remote name in git status page
Product: [ECD] Orion Reporter: John Arthorne <john.arthorne>
Component: GitAssignee: libing wang <libingw>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: mamacdon, simon_kaegi, susan, tomasz.zarna
Version: unspecifiedFlags: simon_kaegi: review+
Target Milestone: 0.3 RC3   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Screen shot
none
Fix patch for review none

Description John Arthorne CLA 2011-10-14 16:02:48 EDT
0.3 RC2

I have a git repository with two configured remotes: "origin" and "heroku". My current active branch is using "heroku" remote. When I go to the git status page, it still says "origin/master" at the top of the remote log pane. However, from looking at the log it seems to be showing the correct thing ("heroku/master"). So it looks like the label is wrong.

In fact there is no indication on this page of what remote I am using. Maybe that information should be in the title area at the top as well.
Comment 1 John Arthorne CLA 2011-10-14 16:05:20 EDT
Created attachment 205234 [details]
Screen shot

In this screenshot my mouse is hovering over the "Complete log" link. You can see that the title says origin/master but the link is pointing to heroku/master.
Comment 2 John Arthorne CLA 2011-10-14 16:06:16 EDT
This might seem trivial but this wrong information could cause someone to be blissfully pushing to the wrong remote without realizing it, so marking "major".
Comment 3 libing wang CLA 2011-10-17 10:08:33 EDT
(In reply to comment #2)
> This might seem trivial but this wrong information could cause someone to be
> blissfully pushing to the wrong remote without realizing it, so marking
> "major".

Investigating and try to fix in RC3.
Comment 4 Simon Kaegi CLA 2011-10-17 12:18:06 EDT
Worthwhile, but still need someone to review the actual code change when ready.
Comment 5 libing wang CLA 2011-10-17 12:23:29 EDT
(In reply to comment #4)
> Worthwhile, but still need someone to review the actual code change when ready.

Found the reason:
The remote info has two children in this case.And the second child is the current remote. As the children do not have "current" flag , we are always using the first child as current, which is dangerous.
We should use this._curBranch.RemoteLocation[0].Name  instead of this._remoteInfo.Children[0].Name.
Also we should use remote name +  branch name  in the title bar as John suggested.

I have a fix now, will polish it and ask Mark to review.
Comment 6 libing wang CLA 2011-10-17 12:56:53 EDT
Created attachment 205353 [details]
Fix patch for review

Mark, I've created the patch for you to review. Thanks.
Comment 7 Mark Macdonald CLA 2011-10-17 15:20:59 EDT
+1 from me
Comment 8 libing wang CLA 2011-10-17 15:29:17 EDT
fixed with 3c4e12deff75ab1ce4ce47e634c6b20910e75fb5.