Bug 3616 - [REGRESSION] VersionControl (git) says files modified that aren't (2.8.8.0rc3)
Summary: [REGRESSION] VersionControl (git) says files modified that aren't (2.8.8.0rc3)
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Version Control ()
Version: Trunk
Hardware: PC Mac OS
: Highest normal
Target Milestone: 2.8.7
Assignee: Alan McGovern
URL:
Depends on: 3675
Blocks:
  Show dependency tree
 
Reported: 2012-02-23 16:09 UTC by Jeffrey Stedfast
Modified: 2012-02-29 06:46 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Jeffrey Stedfast 2012-02-23 16:09:49 UTC
In MonoDevelop 2.8.8.0rc3, if I open the MonoDevelop solution, there are "edited" overlay icons over random un-changed files in my tree view.

Such as:

Mono.TextEditor/
   EmacsWordFindStrategy.cs
   IWordFindStrategy.cs
   SearchRequest.cs
   SharpDevelopWordFindStrategy.cs
   StringBuffer.cs


There are others as well in other namespaces...

I have not (ever) edited these files. Requesting a "Diff" in the MD UI shows no differences nor does `git diff` nor `git diff --cached` from a terminal.
Comment 1 Jeffrey Stedfast 2012-02-23 16:13:56 UTC
These same files do not show as edited in MonoDevelop 2.8.6.5
Comment 2 Alan McGovern 2012-02-27 19:13:39 UTC
I can't reproduce this issue with master (which should be the same as 2.8.8). Eveything looks fine to me. Can you still reproduce this? Also, does it happen with a fresh checkout? Could this be an auto cr-lf thing?
Comment 3 Jeffrey Stedfast 2012-02-27 19:44:58 UTC
I can still reproduce opening my monodevelop project and git diff and git diff --cached show no changes - for example, ./main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExpressionEvaluatorExtensionNode.cs

I can't seem to repro if I open a fresh checkout of the monodevelop project (then again, I haven't actually expanded every single node in the md project either, because there are just *too many* nodes to expand).


I just did `git checkout ./main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExpressionEvaluatorExtensionNode.cs`

then launched monodevelop master and opened the MonoDevelop project. That file is still showing as modified.
Comment 4 Jeffrey Stedfast 2012-02-27 19:47:29 UTC
oh, if it wasn't clear, that file doesn't show up as modified if I open the MonoDevelop.mdw of a fresh checkout.

The Mono.TextEditor files are strangely not showing up as modified anymore even though I haven't committed or refreshed them in any way.
Comment 5 Alan McGovern 2012-02-28 11:21:06 UTC
I can't trigger the issue here. Can you either zip up the directory containing the files which trigger the issue and send it to me or help me debug it via some carefully placed debugger breakpoints within monodevelop? There are several potential causes of this such as auto crlf being done incorrectly or file mode attributes changing, or timestamps being slightly inaccurate and throwing the calculation off. I find it odd that they are only marked as modified in the solution pane though.
Comment 6 Alan McGovern 2012-02-28 20:38:32 UTC
The root issue is that ngit does not properly respect the autocrlf settings. This issue can be replicated as follows:

1) Check out monodevelop using the commandline git client
2) find . | xargs touch  (this will change the modification date on all the files)
3) Open the monodevelop solution in MD

Result:
Every text file which has crlf endings will show up as modified. This is because NGit does not read the .gitattributes file and so does not realise that the files are actually marked as autocrlf=false (no conversions) and so incorrectly does the conversion when calculating the hash of the file. This causes the ngit calculated hash to be different to the repository hash and so the file is marked as different.

The proper fix is to add support for reading the .gitattributes file.
Comment 7 Alan McGovern 2012-02-29 06:46:51 UTC
The root cause of this particular bug has just been fixed with a patch to ngit which I am trying to upstream to jgit itself. Jgit does not handling autocrlf=input correctly wrt the working tree. This is the root cause of this particular issue.

As bug #3675 is tracking the issue with ngit not supporting .gitattributes I am going to close this bug.