Bug 15608 - Error generated for generated code that is not committed in the repo
Summary: Error generated for generated code that is not committed in the repo
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Version Control ()
Version: Trunk
Hardware: PC Linux
: Normal normal
Target Milestone: master
Assignee: Marius Ungureanu
Depends on:
Reported: 2013-10-23 04:29 UTC by Andres G. Aragoneses
Modified: 2014-04-28 10:58 UTC (History)
3 users (show)

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:

Description Andres G. Aragoneses 2013-10-23 04:29:08 UTC
By using gtk-sharp.sln[1], with MD master as of today (5082d005ef1a51dfe4957af31c92cf9c269a85da), I'm getting these errors in the console:

ERROR [2013-10-23 10:26:30Z]: VersionControl returned 2 items for /home/knocte/Documents/Code/gtk-sharpFIXCAIRODISPOSES/gtk/generated/CellRenderer.cs
ERROR [2013-10-23 10:26:30Z]: The infos were: /home/knocte/Documents/Code/gtk-sharpFIXCAIRODISPOSES/gtk/generated ::: /home/knocte/Documents/Code/gtk-sharpFIXCAIRODISPOSES/gtk/generated/CellRenderer.cs
ERROR [2013-10-23 10:26:30Z]: 
System.InvalidOperationException: Sequence contains more than one matching element
  at System.Linq.Enumerable.Single[VersionInfo] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback) [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable.Single[VersionInfo] (IEnumerable`1 source) [0x00000] in <filename unknown>:0 
  at MonoDevelop.VersionControl.Repository.GetVersionInfo (FilePath localPath, VersionInfoQueryFlags queryFlags) [0x00090] in /home/knocte/Documents/Code/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs:161 
  at MonoDevelop.VersionControl.Views.SubviewAttachmentHandler.HandleDocumentChanged (System.Object sender, System.EventArgs e) [0x000c1] in /home/knocte/Documents/Code/monodevelop/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs:68 

[1] https://github.com/mono/gtk-sharp/blob/master/gtk-sharp.sln
Comment 1 Alan McGovern 2013-10-23 08:27:43 UTC
This used to be caused by submodules, but I believe we have dealt with that case. I'm not sure why this is happening. What is the result from 'git diff' or 'git status' from commandline git?

The interesting thing is that GetVersionInfo is returning a directory *and* a file when we query for just a file.
Comment 2 Andres G. Aragoneses 2013-10-23 08:32:32 UTC
> What is the result from 'git status' from commandline git?

Right now, this (although not sure if it was exactly this when I reproduced the error):

$ git status
# On branch fix_cairo_leak
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#	modified:   cairo/Context.cs
#	modified:   generator/GObjectVM.cs
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#	0001-cairo-check-earlier-for-IntPtr.Zero-in-Dispose-bool-.patch
#	generator/obj/
#	out.txt
no changes added to commit (use "git add" and/or "git commit -a")
Comment 3 Alan McGovern 2013-10-23 08:37:19 UTC
Actually maybe the issue is that the 'generated' directory is marked as git ignore but we're recursing into it anyway? Does that sound likely? Is 'gtk-sharpFIXCAIRODISPOSES/gtk/generated' an ignored directory?
Comment 4 Andres G. Aragoneses 2013-10-23 08:52:45 UTC
> Does that sound likely?

Yes, that's why I named the bug like it is :)

> Is 'gtk-sharpFIXCAIRODISPOSES/gtk/generated' an ignored directory?

Yes: https://github.com/mono/gtk-sharp/blob/master/.gitignore#L22
Comment 5 Marius Ungureanu 2014-01-14 05:06:56 UTC
Gitignores should be handled by NGit. Maybe the treewalk is stupider than I thought. Will check it out.
Comment 6 Marius Ungureanu 2014-04-28 10:58:45 UTC
This is fixed now by having a workaround having been applied for #17216.