Automatically switch to the Git provider when loading a Git-controlled solution

Aug 5, 2011 at 4:47 PM

Another point for today: I've noticed that the Git provider is not active and thus does not show any icons in a Git-controlled solution if I previously switched to AnkhSVN or loaded an SVN-controlled solution. Only after manually selecting the Git provider from the VS|Tools|Settings menu, I can see the file status icons again and perform Git operations.

It seems that AnkhSVN can select itself automatically when an SVN-controlled solution is loaded. But it doesn't work the other way round. I don't know the magic behind things but I guess the Git provider should also do this. Otherwise it's really complicated when dealing with SVN and Git solutions (like when slowly migrating from SVN to Git for new projects) and opening them a lot. And it's always the Git side that causes the extra work. :-(

Coordinator
Aug 6, 2011 at 12:52 AM
Edited Nov 14, 2011 at 12:47 PM

Hi LonelyPixel,

Thanks for your message.
Source control in VS works like this: When VS launching, it loads previous provider it used before last time exit. e.g. If you close VS when using Git, next time you run VS, it loads Git. Once Git provider is loaded into the memory of VS, it will recognize Git project and switch to Git provider automatically. Even you witched to SVN project, it will auto switch to Git when opened Git project. If you close VS when using SVN, next time you run VS, it loads SVN. Git provider is not in memory. So you need to manually select the Git provider from the Tools | Options to load it.
AnkhSVN stays in memory for ever and it modifies your solution file so that it can let VS activate itself. I really hesitated to do so. I don't want to modify solution file and don't want load Git provider into memory if it is not used. If you don't switch to SVN and exit VS, it will keep working w/o need a manual selection. That's a trade off.
Regards,
yysun
Aug 7, 2011 at 10:24 AM

Thank you for the insights. While I share the idea that the solution file should better not be touched by the source control provider, I'd definitely like to see more ease of use when working with both SVN and Git. Maybe there could be some option for the Git provider to stay in memory, or another VS add-in to do the switch automatically when loading a Git-controlled solution? If that's technically possible. I've tried recording a macro, but all it contained was the command to open the settings dialogue, no details about what happened in there.

Coordinator
Nov 14, 2011 at 12:52 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.