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

Bug 339109

Summary: [server] Provide REST API for git remote
Product: [ECD] Orion Reporter: Tomasz Zarna <tomasz.zarna>
Component: ClientAssignee: Szymon Brandys <Szymon.Brandys>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: janikpiotrek, Szymon.Brandys
Version: 0.2Flags: Szymon.Brandys: review+
Target Milestone: 0.2   
Hardware: PC   
OS: Windows XP   
URL: http://www.kernel.org/pub/software/scm/git/docs/git-remote.html
Whiteboard: gsoc2011
Bug Depends on: 347906    
Bug Blocks: 336116, 344215    

Description Tomasz Zarna CLA 2011-03-07 11:05:59 EST
We're going to need REST API for git remote (tracking remote branches).
Comment 2 Piotr Janik CLA 2011-05-23 12:16:42 EDT
I've got a question about existing part of this REST API: GET /git/remote/{remote_name}/file/{project} 
Response contains some information about remote and ALL branches in the repository ('children' section). So, i.e. when I send request for remote "test", children section contains branch refs/remotes/origin/master. Is it correct behaviour or a bug?
Comment 3 Piotr Janik CLA 2011-05-23 17:29:19 EDT
Early version ready for review (remote add and remote rm).
Comment 4 Tomasz Zarna CLA 2011-05-24 04:00:19 EDT
(In reply to comment #2)
> [...] when I send request for remote "test",
> children section contains branch refs/remotes/origin/master. Is it correct
> behaviour or a bug?

This is expected. We give brief info about remote branches when asking about branch. The user can then fetch details about a branch by following BranchLocation.
Comment 5 Szymon Brandys CLA 2011-05-25 10:11:12 EDT
Piotrek I would rather use:

(1)
POST /git/remote/file/[path]/
{
Name: remoteName
URL: remoteURL
...
}

instead of:

(2)
PUT /git/remote/[remoteName]/file/[path]/

The reason is, we have (1) already when we try to create a new remote and we would have to craft (2) manually to send PUT for it.
Comment 6 Szymon Brandys CLA 2011-05-26 06:14:25 EDT
I released changes to the server code. We still need tests and our wiki with Git REST API updated. When these two things are done, we may close the bug.
Comment 7 Piotr Janik CLA 2011-05-31 12:25:03 EDT
Git REST API is updated.
Tests and fixes: https://github.com/pjanik/orion.server/tree/bug339109update1
[I wrote all this code and have the rights to contribute it to Eclipse under the eclipse.org web site terms of use]
Comment 8 Tomasz Zarna CLA 2011-06-01 07:04:06 EDT
Piotrek, please take a look at bug 347906.
Comment 9 Szymon Brandys CLA 2011-06-01 08:26:49 EDT
Tests added with 1652ad0af262a8b383222b9195666b363673663f.