| Summary: | [server] Provide REST API for git commit | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Tomasz Zarna <tomasz.zarna> |
| Component: | Client | Assignee: | Tomasz Zarna <tomasz.zarna> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P2 | CC: | libingw, Szymon.Brandys |
| Version: | 0.2 | ||
| Target Milestone: | 0.2 | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
| Bug Depends on: | 338200, 339088 | ||
| Bug Blocks: | 336116 | ||
|
Description
Tomasz Zarna
Partially fixed with 7cd152c9c693e5993ad02275ca3d1c0168d0dace.
To commit all staged files, do POST on /git/commit/file/{projectId} passing {"Message"[1]:<commit message>} in body. "Amend"[2] param is not yet supported, neither is committing a single file. I'm not able to specify these using CommitCommand[3]. I'll try to work around that limitation.
To get a file content from HEAD, call GET on /git/commit/HEAD/file/{path}. For now only "HEAD" ref is accepted, but this could be extended in the future.
[1] org.eclipse.orion.server.git.GitConstants.KEY_COMMIT_MESSAGE
[2] org.eclipse.orion.server.git.GitConstants.KEY_COMMIT_AMEND
[3] org.eclipse.jgit.api.CommitCommand
(In reply to comment #1) > "Amend"[2] param is not yet supported, See bug 339088. > neither is committing a single file. See http://egit.eclipse.org/r/#change,2635. Amending can be achieved by doing POST on /git/commit/file/{projectId} and passing an extra parameter in request body: {..., "Amend":"true"}. When omitted or set to "false" a regular commit is made.
So, the last missing bit here is being able to commit a single file (provide a path to commit). I'm keeping my fingers crossed for http://egit.eclipse.org/r/#change,2635, which should be helpful here.
(In reply to comment #3) > So, the last missing bit here is being able to commit a single file (provide a > path to commit). The last missing part has been moved to bug 339190. Marking as fixed. |