| Summary: | JGit does no give back correct unified diff on files with mixed line ending. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | libing wang <libingw> | ||||
| Component: | Git | Assignee: | Project Inbox <orion.git-inbox> | ||||
| Status: | RESOLVED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | Silenio_Quarti, Szymon.Brandys | ||||
| Version: | 0.5 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 221918 [details]
the file with mixed ending at line 150
I fixed the line ending at line 150 at annotations.js http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=f2e6a3943ba2d53d5191d13ce2548e9be9461301. This is not resolving the issue generically. We need the server to give back correct diff on mixed line ending cases. Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see: https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see: https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html |
Just happened to find this file has mixed line ending at line 150(1 based number) annotations.js. I will fix the line ending for this case but we need a solution on any other files that has this case. Steps to reproduce: 1.Download the attached annotations.js. 2.Upload to Orion in a temporary folder 3.Commit 4.Change line 150 5.Open git status page you will see that the diff is showing wrong. I debugged on the diff response from server and found this: "diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/textview/annotations.js b/bundles/org.eclipse.orion.client.editor/web/orion/textview/annotations.js" "index 5291bda..acd1c72 100644" "--- a/bundles/org.eclipse.orion.client.editor/web/orion/textview/annotations.js" "+++ b/bundles/org.eclipse.orion.client.editor/web/orion/textview/annotations.js" "@@ -147,7 +147,7 @@" " * @param {String} type The annotation type (for example, orion.annotation.error). " " * @param {Object|Function} properties The common annotation properties of the registered " " * annotation type. All annotations create with this annotation type will expose these " "- * properties. */ " "+ * test properties. */ " " AnnotationType.registerType = function(type, properties) { " " var constructor = properties; " " if (typeof constructor !== "function") { //$NON-NLS-0$ " The original fiel at line 149-151 was like this * annotation type. All annotations create with this annotation type will expose these * properties. */ Apparently JGIT treated line 150 and 151 as one line.