Community
Participate
Working Groups
In M7 , we need a new server API so that we can compare any two file URI. The compare html should also change he URL format to some thing like /diff/file1?file2
Comparing two files that are under control of a git repository could be done using a similar API as suggested on bug 339682, comment 1. As for any two files, which are not necessarily part of a git repository I don't think /git/diff/ is the right API to talk to. We could get away with implementing generic diff under /diff/ which would use "git diff" under the hood, for now. Eventually, we should keep these things separated. We should also keep in mind a scenario when the user would like to compare a file from her workspace (/file/{projectId}/file.txt) with any resource on the web (http://{host}/...).
Agree with everything you said Tomek. An API to compare any two *commits* is fine as part of the GIT API. But, an API to compare any two files in the workspace shouldn't be part of the git API. We always need to keep the Git functionality separate to allow for other SCMs to integrate with Orion.
The Orion compare editor needs three resources right now. The content of the left, right input and the unified diff (to mark changes in the UI). Right now URIs of the resources are just crafted in the compare code. In the nearest future I would expect that the Diff representation will look like this [1]: - location (URI) of the left side content - location of the right side content - location of the Diff itself - the Diff content When we add more compare services (like the service for comparing files), we just need to make sure that they use the same representation i.e. [1] for their Diff resources. If it is true, the compare UI will just render it, no matter what service provides the Diff. In other words, if we have Diff URI e.g. http://myserver/myDiff and it returns a Diff representation like in [1], http://orion/compare.html#http://myserver/myDiff would work showing a proper compare UI. Libing, is the Diff representation [1] ok for you? We should stop crafting URIs in the compare code (and in the client code in general) and you should get all URIs (directly or indirectly) from the Diff resource.
(In reply to comment #3) > The Orion compare editor needs three resources right now. The content of the > left, right input and the unified diff (to mark changes in the UI). Right now > URIs of the resources are just crafted in the compare code. > In the nearest future I would expect that the Diff representation will look > like this [1]: > - location (URI) of the left side content > - location of the right side content > - location of the Diff itself > - the Diff content > When we add more compare services (like the service for comparing files), we > just need to make sure that they use the same representation i.e. [1] for their > Diff resources. If it is true, the compare UI will just render it, no matter > what service provides the Diff. > In other words, if we have Diff URI e.g. http://myserver/myDiff and it returns > a Diff representation like in [1], > http://orion/compare.html#http://myserver/myDiff would work showing a proper > compare UI. > Libing, is the Diff representation [1] ok for you? We should stop crafting URIs > in the compare code (and in the client code in general) and you should get all > URIs (directly or indirectly) from the Diff resource. Yo uare right , Szymon. And we still need another REST call to get he original file content.
We are focused on Git diff in M7. We don't plan to provide a general diff mechanism for files in the workspace (not shared via Git or any other SCM). Speak up, if it is part of your plan.
(In reply to comment #5) > We are focused on Git diff in M7. We don't plan to provide a general diff > mechanism for files in the workspace (not shared via Git or any other SCM). > Speak up, if it is part of your plan. Had a conversation with tomasz yestoday .Should be OK in M7 by using diffURI , which has the infomation of two commits My original purpose of this bug was t obe able to compare two commits , at least. So the title of this bug should be changed to "able to compare any two commits"
(In reply to comment #6) > Had a conversation with tomasz yestoday .Should be OK in M7 by using diffURI , > which has the infomation of two commits > My original purpose of this bug was t obe able to compare two commits , at > least. > So the title of this bug should be changed to "able to compare any two > commits" This is in the plan for M7 then.
(In reply to comment #6) > My original purpose of this bug was t obe able to compare two commits You're able to do that right now. If you don't know the diff URI go to bug 339682 and see how to get it. If the response is not what you need, you're probably looking for bug 340449. *** This bug has been marked as a duplicate of bug 339682 ***