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

Bug 389412

Summary: Saving files may cause in diff seeing changes in every line
Product: [ECD] Orion Reporter: Maciej Bendkowski <maciej.bendkowski>
Component: ClientAssignee: libing wang <libingw>
Status: RESOLVED WONTFIX QA Contact:
Severity: major    
Priority: P3 CC: libingw, maciej.bendkowski, Silenio_Quarti, susan
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Maciej Bendkowski CLA 2012-09-12 11:19:46 EDT
Some time ago I've noticed a strange editor behavior. I do some changes in a file, e. g. gitCommands and check git status. The diff sees changes in every line even if added one character or just saved the file again! This does not happen on every file and on each save. Usually when I notice the problem i switch to master, reset and type the changes again (this time, diff sees changes only where I made them). If I commit a file successfully with correct diff status the problem won't occur anymore. Only if I touch a file which was forked by creating a new branch the problem might occur. Does not happen in a deterministic way, but is a pain when it does. I tested this behavior on firefox and chrome - no difference. Does anyone encountered this problem besides me?
Comment 1 Susan McCourt CLA 2012-09-12 13:12:56 EDT
I think you are seeing some changes in line delimiters.  I suspect you are running a local git with core.autocrlf=true.

For a big discussion of this, see bug 349096 and in particular bug 349096 comment 8.

I'm not sure it's exactly your scenario but this bug should shed some light on the situation.
Comment 2 Maciej Bendkowski CLA 2012-09-21 10:46:01 EDT
(In reply to comment #1)
> I'm not sure it's exactly your scenario but this bug should shed some light
> on the situation.

Thanks for the hint. I explicitly set core.autocrlf to false and since then no problems occurred.
Comment 3 Maciej Bendkowski CLA 2013-09-23 07:29:04 EDT
I can still reproduce even if I set the core.autoctrlf to false in the repository git configuration. Amending and adding/removing temporary new lines does not help. A workaround here is to checkout the file, and start coding again. I can't reproduce using a console git client, e. g. mysysgit.
Comment 4 libing wang CLA 2013-09-23 14:48:47 EDT
Git status is using "git diff" in stead of "compare two file URIs on the client side"

If you are still reproducing it, could you verify the following steps.
1.Use Chrome. In git status page expand the file to see diff.
2.In chrome developer tools, look at the network tab. Find the request similar to "/gitapi/diff/...../yourChangedFile.js?parts=uris".
3.In the response body of this request, find "New" and "Old" file URIs.
4."New" is the URIs representing the file in your working directory while "Old" represents the file in the git index.
5.Now use "youOrionServer/orion/compare/examples/standalone/demo.html".
6.Choose "compare with two file URLs" on the top left corner of the page. Then paste two file URIs in the left and right pane respectively.
7.Press "Compare again" button in the demo page.

If you see the proper diff at this moment, that means the "git diff" gives the wrong answer.

We should think about using "pure client side diff" depending on your verification results.
Comment 5 John Arthorne CLA 2015-05-05 16:21:13 EDT
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