Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353557 - [server] Allow to push new branches to any remote
Summary: [server] Allow to push new branches to any remote
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Git (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 0.3 M1   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 353733 354144
  Show dependency tree
 
Reported: 2011-08-02 06:29 EDT by Tomasz Zarna CLA
Modified: 2011-08-09 11:48 EDT (History)
1 user (show)

See Also:


Attachments
mylyn/context/zip (28.06 KB, application/octet-stream)
2011-08-08 11:00 EDT, Tomasz Zarna CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Zarna CLA 2011-08-02 06:29:08 EDT
Currently, new branches can only be pushed to a remote called "origin". We're going to need REST API for git push to any remote.

The UI is already there, see bug 347892.
Comment 1 Tomasz Zarna CLA 2011-08-03 06:49:54 EDT
Changes pushed to a remote branch http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/?h=bug353557 as http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?h=bug353557&id=1f2e84b4e3250a62c8544be4f8f5096bf4fee4ab

Waiting for a green light from bug 353733 to release the changes to master.
Comment 2 Malgorzata Janczarska CLA 2011-08-04 06:33:00 EDT
The API you are returning is not sufficient for the client. All we get is a remote branch location, that may not exist yet, so doing GET on it can return 404.
If a user wants to pick a remote branch he is committing to he should be provided with at least those information:
1. Remote details (Name, URI etc)
2. Remote branch name

When we list remote tracking branches for a remote we get a response that looks like this:
{
  "Children": [
    {
      "BranchLocation": "/gitapi/branch/file/1/",
      "CloneLocation": "/gitapi/clone/file/1/",
      "CommitLocation": "/gitapi/commit/79ff9d3266a495d1a7affd2e7bb5e3c8ed4f184d/file/1/",
      "FullName": "refs/remotes/origin/test",
      "HeadLocation": "/gitapi/commit/HEAD/file/1/",
      "Id": "79ff9d3266a495d1a7affd2e7bb5e3c8ed4f184d",
      "IndexLocation": "/gitapi/index/file/1/",
      "Location": "/gitapi/remote/origin/test/file/1/",
      "Name": "origin/test",
      "Type": "RemoteTrackingBranch"
    },
    {
      "BranchLocation": "/gitapi/branch/file/1/",
      "CloneLocation": "/gitapi/clone/file/1/",
      "CommitLocation": "/gitapi/commit/9beebef2ae1ff0d8f62af1e5f151bd2e60b25694/file/1/",
      "FullName": "refs/remotes/origin/gh-pages",
      "HeadLocation": "/gitapi/commit/HEAD/file/1/",
      "Id": "9beebef2ae1ff0d8f62af1e5f151bd2e60b25694",
      "IndexLocation": "/gitapi/index/file/1/",
      "Location": "/gitapi/remote/origin/gh-pages/file/1/",
      "Name": "origin/gh-pages",
      "Type": "RemoteTrackingBranch"
    },
    {
      "BranchLocation": "/gitapi/branch/file/1/",
      "CloneLocation": "/gitapi/clone/file/1/",
      "CommitLocation": "/gitapi/commit/79ff9d3266a495d1a7affd2e7bb5e3c8ed4f184d/file/1/",
      "FullName": "refs/remotes/origin/master",
      "HeadLocation": "/gitapi/commit/HEAD/file/1/",
      "Id": "79ff9d3266a495d1a7affd2e7bb5e3c8ed4f184d",
      "IndexLocation": "/gitapi/index/file/1/",
      "Location": "/gitapi/remote/origin/master/file/1/",
      "Name": "origin/master",
      "Type": "RemoteTrackingBranch"
    }
  ],
  "Location": "/gitapi/remote/origin/file/1/",
  "Name": "origin",
  "Type": "Remote"
  }
  
  Maybe we could return a list of similar objects, but only limited to the branches that user may commit to?
Comment 3 Tomasz Zarna CLA 2011-08-04 12:18:33 EDT
I've updated http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/?h=bug353557, please check it out and give it a spin. Comments are welcome.
Comment 4 Tomasz Zarna CLA 2011-08-08 11:00:10 EDT
Created attachment 201083 [details]
mylyn/context/zip