Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342602 - [server] Use references like /refs/remote/origin/master in /git/commit
Summary: [server] Use references like /refs/remote/origin/master in /git/commit
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Git (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 0.5 M2   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 347943
Blocks: 377509
  Show dependency tree
 
Reported: 2011-04-12 11:59 EDT by Tomasz Zarna CLA
Modified: 2012-04-24 09:01 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Zarna CLA 2011-04-12 11:59:44 EDT
Currently, GitCommitHandlerV1 expects a single segment after /git/commit that identifies a revision e.g. /git/commit/{commit1}/file/{path} to show commits between Beginning of Time and commit1. To get a list of commits in a remote branch it would be convenient to use the same notation as in git console i.e. origin/master. The problem is that the current implementation of the handler will take "origin" and fail to resolve it.

A workaround Szymon suggested is to encode refs containing "/".
Comment 1 Tomasz Zarna CLA 2012-04-24 08:23:06 EDT
Most of the job has been already done in bug 347943. The GitCommitHandlerV1 extends now AbstractGitHandler, which decode the git segment, so refs like "refs/remote/origin/master" are handled properly. The Commit URI looks now like this: http://localhost:8080/gitapi/commit/refs%252Fremotes%252Forigin%252Fmaster/file/a/. 

In 9d42d5db616a6773c82c0567e8e0bb26daffc1e0 I updated org.eclipse.orion.server.git.objects.Branch to follow the same rule ie returned encoded full name in the Commit URI property.

See also org.eclipse.orion.server.tests.servlets.git.GitLogTest#testLogRemoteBranch() and #testLogWithBranch().