Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361029 - [client][Status] Wrong remote name in git status page
Summary: [client][Status] Wrong remote name in git status page
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Git (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 0.3 RC3   Edit
Assignee: libing wang CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-14 16:02 EDT by John Arthorne CLA
Modified: 2011-10-17 15:29 EDT (History)
4 users (show)

See Also:
simon_kaegi: review+


Attachments
Screen shot (11.08 KB, image/png)
2011-10-14 16:05 EDT, John Arthorne CLA
no flags Details
Fix patch for review (1.94 KB, patch)
2011-10-17 12:56 EDT, libing wang CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.