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

Bug 339682

Summary: [server] Provide REST API for generating diff between two commits
Product: [ECD] Orion Reporter: Tomasz Zarna <tomasz.zarna>
Component: ClientAssignee: Tomasz Zarna <tomasz.zarna>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: libingw, Szymon.Brandys
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Tomasz Zarna CLA 2011-03-11 08:16:07 EST
First thought: could be implemented as GET /git/diff/{commit}..{commit}/file/{projectId}/[{filePath}]
Comment 1 Szymon Brandys CLA 2011-03-11 11:52:49 EST
We discussed it today. It looks like we need something like this:

POST /git/clone/[resourcePath] and a resource to compare should be passed in the body. The response should contain the location of the diff i.e. /git/diff/[diffLocation] and perhaps the diff result. Later when GET /git/diff/[diffLocation] is called we will get the result of the diff again.
Comment 2 Tomasz Zarna CLA 2011-03-15 09:30:15 EDT
Fixed with 61071497ae1aa5cde44e26f8e8db891fb81ccdd5.

POSTing to a DiffLoaction for a commit[1] with a body containing a pointer to a new revision[2] will return a diff location in Header of the response[3].

[1] e.g. /git/diff/HEAD/file/A/file.txt
[2] { "New" : "HEAD^1" }
[3] Location : {...}/git/diff/HEAD..HEAD^1/file/A/file.txt
Comment 3 Tomasz Zarna CLA 2011-03-30 11:55:31 EDT
*** Bug 339898 has been marked as a duplicate of this bug. ***