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

Bug 348659

Summary: [client] all my git diffs are failing running latest code from git
Product: [ECD] Orion Reporter: Susan McCourt <susan>
Component: ClientAssignee: Tomasz Zarna <tomasz.zarna>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: libingw, mamacdon
Version: 0.2Flags: malgorzata.tomczyk: review+
Target Milestone: 0.2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Susan McCourt CLA 2011-06-07 18:16:14 EDT
I am running on localhost, win7 with:

- latest code from orion git client and server repos
- I20110607-0200 as my target platform

None of the diffs in the git status page are working for me.  Both the inline compare and the side by side compare and failing with suspicious looking URL's.  For example I have a change in globalCommands.js and if I try to look at the diff I get the error:

Unable to load /gitapi/diff/Default/file/A/web/bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js?conflict=true?conflict=true&parts=diff status:500

Note the double ?conflict=true?conflict=true in the URL

Line 849-850 in git-status-table.js looks very suspicious:

var diffURI = (this._model.isConflict(itemModel.type) ? itemModel.diffURI : itemModel.diffURI + "?conflict=true");
this._inlineCompareContainer.resolveDiff(diffURI + "?conflict=true",

I hacked the file to get rid of the duplicate "?conflict=true" but the URL is still not right.

Libing said it was working for him with the latest, but I'm wondering if he had different git-status-table code running when he said this (because he had diffs in that file).

So I think that correct/current code might not be pushed yet and there is failing code in the repo.
Comment 1 Susan McCourt CLA 2011-06-07 18:29:00 EDT
For the two-way compare, I'm seeing something that looks like path munging.  For example:

http://localhost:8080/compare/compare.html#/gitapi/diff/Default/file/k/bundles/bundles/org.eclipse.orion.client.core/web/orion/breadcrumbs.js

This fails.
If I change the browser bar location so get rid of the extra "/bundles" segment, then it works.
Comment 2 Susan McCourt CLA 2011-06-07 18:32:43 EDT
Mark noticed that it works correctly if you open git-status from the root directory of the repo.

But if you open git-status from somewhere below the root, you see both of these diff errors.

This is very discouraging because I thought git-status is not supposed to be scoped in any way.
Comment 3 Susan McCourt CLA 2011-06-07 18:36:39 EDT
(In reply to comment #2)
> This is very discouraging because I thought git-status is not supposed to be
> scoped in any way.

I'm saying this based on discussion from bug 339558 (in particular see bug 339558 comment 9 and bug 339558 comment 10).  

Whether or not we show the git-status command from subfolders, I would expect the page to behave the same once it opens.  It seems like we have a subtle difference somewhere that shouldn't be so.
Comment 4 libing wang CLA 2011-06-08 08:40:50 EDT
(In reply to comment #2)
> Mark noticed that it works correctly if you open git-status from the root
> directory of the repo.
> 
> But if you open git-status from somewhere below the root, you see both of these
> diff errors.
> 
> This is very discouraging because I thought git-status is not supposed to be
> scoped in any way.

I reproduced it in a sub folder , investigating it now.
Comment 5 libing wang CLA 2011-06-08 08:53:32 EDT
Hi , Tomasz :
Please look at this .
When I go to git status page from a sub folder , from the git status REST API I saw that the all the file locations  have double "/bundles" 
	
CommitLocation
	"/gitapi/commit/HEAD/file/K/bundles/bundles/org.eclipse.orion.client.core/web-ide.conf"
	
DiffLocation
	"/gitapi/diff/Default/file/K/bundles/bundles/org.eclipse.orion.client.core/web-ide.conf"
	
IndexLocation
	"/gitapi/index/file/K/bundles/bundles/org.eclipse.orion.client.core/web-ide.conf"
	
Location
	"/file/K/bundles/bundles/org.eclipse.orion.client.core/web-ide.conf"
	
Name
	"bundles/org.eclipse.orion.client.core/web-ide.conf"
	
Path
	"org.eclipse.orion.client.core/web-ide.conf"