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

Bug 359710

Summary: [compare] More generic Diff JSON representation
Product: [ECD] Orion Reporter: Szymon Brandys <Szymon.Brandys>
Component: ClientAssignee: Project Inbox <orion.client-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: libingw, tomasz.zarna
Version: unspecified   
Target Milestone: 0.3   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Szymon Brandys CLA 2011-10-03 10:06:31 EDT
I noticed that the compare framework looks for the Git key in Diff JSONs. Since the compare may be used with various diff providers, we should use more generic name for this particular key.
So far the diff representations expected by the compare looks like this: 

--QBsq4sftABAQAaNRbB60wA
Content-Type: application/json; charset=UTF-8

{"Git":
{"Base":"http://localhost:8080/gitapi/index/file/z/a.txt",
"DiffLocation":"http://localhost:8080/gitapi/diff/Default/file/z/a.txt",
"New":"http://localhost:8080/file/z/a.txt",
"Old":"http://localhost:8080/gitapi/index/file/z/a.txt"}
}

--QBsq4sftABAQAaNRbB60wA
Content-Type: plain/text

diff --git a/a.txt b/a.txt
index 8318c86..4c5893c 100644
--- a/a.txt
.
.
.

I would replace the 'Git' key with 'Diff' or just move Base, Old, New to top.
Comment 1 Tomasz Zarna CLA 2011-10-03 10:20:17 EDT
(In reply to comment #0)
> I would replace the 'Git' key with 'Diff' or just move Base, Old, New to top.

I'm up for the latter.
Comment 2 Tomasz Zarna CLA 2011-10-03 11:04:18 EDT
The representation changed to: { "Type": "Diff", "Location" : "...", "Base" : "...", "New" : "...", "Old" : "..." } with http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=617fd5ac2c037e1b023076bc4e414549da77bc65.
Comment 3 Szymon Brandys CLA 2011-10-03 11:09:08 EDT
Compare aligned to this change.