Bug 3241 - MonoDevelop errors when attempting to connect to git repository
Summary: MonoDevelop errors when attempting to connect to git repository
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Version Control ()
Version: 2.8.6
Hardware: Macintosh Mac OS
: High major
Target Milestone: ---
Assignee: Alan McGovern
Depends on: 356
  Show dependency tree
Reported: 2012-02-06 13:33 UTC by Zane
Modified: 2012-03-07 05:47 UTC (History)
2 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 Zane 2012-02-06 13:33:02 UTC
Steps to replicate:

1. Open MonoDevelop
2. Create a new Single-View iPhone Application
3. Right click on the solution and select 'Version Control -> Publish'
4. In the connect to Repository window enter the URL of the git repository you wish to publish to in the URL field.
5. Click OK

MonoDevelop generates this error and the changes are not published:
NGit.Api.Errors.JGitInternalException: No changes
  at NGit.Api.CommitCommand.CreateTemporaryIndex (NGit.ObjectId headId, NGit.Dircache.DirCache index) [0x00000] in <filename unknown>:0 
  at NGit.Api.CommitCommand.Call () [0x00000] in <filename unknown>:0 
  at MonoDevelop.VersionControl.Git.GitRepository.Commit (MonoDevelop.VersionControl.ChangeSet changeSet, IProgressMonitor monitor) [0x000ed] in /Users/builder/data/lanes/monodevelop-mac- 
  at MonoDevelop.VersionControl.Git.GitRepository.Publish (System.String serverPath, FilePath localPath, MonoDevelop.Core.FilePath[] files, System.String message, IProgressMonitor monitor) [0x0008b] in /Users/builder/data/lanes/monodevelop-mac- 
  at MonoDevelop.VersionControl.PublishWorker.Run () [0x00000] in /Users/builder/data/lanes/monodevelop-mac- 
  at MonoDevelop.VersionControl.Task.BackgroundWorker (System.Object state) [0x00000] in /Users/builder/data/lanes/monodevelop-mac-


Runtime: Mono 2.10.8 (tarball Mon Dec 19 17:43:18 EST 2011)

Monotouch: 5.0.4
Comment 1 Alan McGovern 2012-02-22 12:58:21 UTC
This feature appears to work for me. I create a new (empty) repository on www.github.com and then published a new project directly to the repository url. 

I believe this error can be triggered by trying to publish a repository which is already under git version control. Can you verify that the project throwing this exception does not have a ".git" directory in the root of directory of the solution?
Comment 2 Zane 2012-02-22 15:24:00 UTC
So. I can reproduce the bug and I discovered others in the process. Authentication doesn't work. Even when I've established an ssh connection to GitHub in the terminal, I still get prompted with a dialog, which never works, even if I entered the correct password. To answer your question, The project has a local git repository in it once I cancel the dialog. This issue seems to happen once I cancel creating a remote git repository and have the local git repository created.
Comment 3 Zane 2012-02-22 16:35:38 UTC
Here's a link to the video of the bug. It's to big to upload here so I put it in my dropbox:

Comment 4 Zane 2012-02-22 17:02:28 UTC
Okay, little mistake I made. I'm testing on 2.9.1. Big difference. I'll see if these bugs are present on 2.8.8 and 2.8.6. Sorry about that.
Comment 5 Zane 2012-02-23 18:07:24 UTC
Okay so I tested publishing to a git repository on 2.8.6 and 2.8.8 RC2. I was unable to publish in both cases. I don't think this is a regression then. I even tried on a different machine with no luck. All the same errors happened.
Comment 6 Alan McGovern 2012-02-28 05:06:31 UTC
There are two issues here. Firstly, the patch which I made to prevent users from 'publishing' a project which is already under version control was not included in the 2.8.8 build. I will backport that now.

Secondly, when a project is under local git version control such as what happened here, the correct procedure to push the code to a remote is something like:

1) Go to the 'Manage Branches and Remotes' dialog
2) Add the url for the remote repository there
3) Push your local branch to a remote branch in your repository

I think you are hitting bug #356 currently. I have prioritised that issue and will try to figure out why some private keys can't be loaded. You can work around the issue by using the https method to connect to github instead of ssh/scp.
Comment 7 Zane 2012-03-01 17:29:37 UTC
I think you're right about hitting #356. I just tried adding a remote branch and pushing my changes to that branch and I was unable to authenticate. However, when I try connecting over https to a newly created remote repository I get a different error:

Version control operation failed: https://github.com/zanew-xamarin/VCTest: https://github.com/zanew-xamarin/VCTest/info/refs?service=git-receive-pack not found. https://github.com/zanew-xamarin/VCTest: https://github.com/zanew-xamarin/VCTest/info/refs?service=git-receive-pack not found

NGit.Errors.NoRemoteRepositoryException: https://github.com/zanew-xamarin/VCTest: https://github.com/zanew-xamarin/VCTest/info/refs?service=git-receive-pack not found
  at NGit.Transport.TransportHttp.Connect (System.String service) [0x00158] in /Users/builder/data/lanes/monodevelop-mac-master/20173f3c/source/monodevelop/main/contrib/NGit/NGit.Transport/TransportHttp.cs:519
Comment 8 Alan McGovern 2012-03-01 17:57:42 UTC
I believe the correct https url is of the form: https://alanmcgovern@github.com/alanmcgovern/delete_me.git

Are you missing the ".git" from your repository url? I just created a new github repo and pushed to it using the https url with no issues.
Comment 9 Zane 2012-03-02 15:34:53 UTC
I think the authentication thing might have something to do with me because now I'm getting the same issue when I'm trying to connect via the terminal.

I have multiple git accounts and I think I'm just going to switch to my personal one just to avoid headaches.
Comment 10 Alan McGovern 2012-03-06 05:09:16 UTC
Should this bug be closed or are there still issues which need to be fixed?
Comment 11 Alan McGovern 2012-03-07 05:47:15 UTC
I think this has all been resolved now.