| Summary: | [server] Provide REST API for git checkout | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Tomasz Zarna <tomasz.zarna> |
| Component: | Client | Assignee: | Tomasz Zarna <tomasz.zarna> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P2 | CC: | bokowski, libingw, Szymon.Brandys |
| Version: | 0.2 | ||
| Target Milestone: | 0.2 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| URL: | http://www.kernel.org/pub/software/scm/git/docs/git-checkout.html | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 336116, 341384, 344280 | ||
|
Description
Tomasz Zarna
yes, switching to a branch, but also "get rid of my local changes for this one file". *** Bug 344281 has been marked as a duplicate of this bug. *** Fixed with http://git.eclipse.org/c/e4/org.eclipse.orion.server.git/commit/?id=de02a01c00b7c246fd4c401e63774c919a0c9888. "git checkout -- {paths}" implemented as PUT on /git/clone/file/{path to folder with clone} with { "Path" : [ "{path1}", "{path2}" ] } as JSON request body "git checkout "branch"" implemented as PUT on /git/clone/file/{path to folder with clone} with { "Branch" : "{branch}" } as JSON request body For "git checkout {tree-ish} -- {paths}" see bug 346206. In case of a failure the API is not doing well at the moment see bug 346201. Should we have the checkout location and the branch name in the git status response ? Otherwise I have to craft it again. major loss of function = major Added CloneLocaton to Git Status response in http://git.eclipse.org/c/e4/org.eclipse.orion.server.git/commit/?id=c8cc60cd4f142db07f36dbfccd9c9646b77f8b55. As for checking out branches, it's done on a different page, see bug 346213, no problems there. (In reply to comment #6) > Added CloneLocaton to Git Status response in > http://git.eclipse.org/c/e4/org.eclipse.orion.server.git/commit/?id=c8cc60cd4f142db07f36dbfccd9c9646b77f8b55. Sorry, it's http://git.eclipse.org/c/e4/org.eclipse.orion.server.git/commit/?id=d0bd4144f789d58888526e2f8802b61f3951784c. I implemented it in UI : PUT http://localhost:8080/git/clone/file/K/ with {"Path":["/file/K/bundles/org.eclipse.orion.client.git/static/git-status.js"]} got this response {"HttpCode":500,"DetailedMessage":"One of setGitDir or setWorkTree must be called.","Message":"Failed to handle /git/clone request for file/K/","Severity":"Error","Code":0} I implemented it in UI : PUT http://localhost:8080/git/clone/file/K/ with {"Path":["/file/K/bundles/org.eclipse.orion.client.git/static/git-status.js"]} got this response {"HttpCode":500,"DetailedMessage":"One of setGitDir or setWorkTree must be called.","Message":"Failed to handle /git/clone request for file/K/","Severity":"Error","Code":0} Equivalents for both "git checkout -- {path}" (this bug) and "git reset HEAD -- {path}" (bug 338202) accept paths in a relative form eg. "folder/file.txt". Take a look at bug 338202, comment 5 or transcription from our last chat. So it does work as expected. However, I agree the format could be changed to what you used in comment 8 ("/file/{projectId}/folder/file.txt"). Since you make those requests from Git Status page I thought the first form would suit you better. Please open a separate bug if you would like to stick to the format from your last comment, but please leave this one as FIXED ;)
(In reply to comment #10) > Equivalents for both "git checkout -- {path}" (this bug) and "git reset HEAD -- > {path}" (bug 338202) accept paths in a relative form eg. "folder/file.txt". > Take a look at bug 338202, comment 5 or transcription from our last chat. So it > does work as expected. However, I agree the format could be changed to what you > used in comment 8 ("/file/{projectId}/folder/file.txt"). Since you make those > requests from Git Status page I thought the first form would suit you better. > Please open a separate bug if you would like to stick to the format from your > last comment, but please leave this one as FIXED ;) I do not have to stick tot the format , I can use the relative path.But where is it from the git status response ? I am using .Location now . Ohh , I got it : "Path": "bundles/org.eclipse.orion.client.git/static/git-status.js" |