Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto fetch of master branch doesn't work with ssh #38

Closed
andreasohlund opened this issue Nov 21, 2013 · 14 comments
Closed

Auto fetch of master branch doesn't work with ssh #38

andreasohlund opened this issue Nov 21, 2013 · 14 comments

Comments

@andreasohlund
Copy link
Contributor

When a user does a fresh clone using SSH we can't auto fetch the master:


Error   1   Error occurred: GitFlowVersion.MissingBranchException: Could not fetch from '[email protected]:Particular/PlatformInstaller.git' since LibGit2 does not support the transport. You have most likely cloned using SSH. If there is a remote branch named 'master' then fetch it manually, otherwise please create a local branch named 'master'. ---> LibGit2Sharp.LibGit2SharpException: An error was raised by libgit2. Category = Net (Error).
This transport isn't implemented. Sorry
   at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
   at LibGit2Sharp.Core.Proxy.git_remote_connect(RemoteSafeHandle remote, GitDirection direction)
   at LibGit2Sharp.Network.Fetch(Remote remote, Nullable`1 tagFetchMode, ProgressHandler onProgress, CompletionHandler onCompletion, UpdateTipsHandler onUpdateTips, TransferProgressHandler onTransferProgress, Credentials credentials)
   at GitFlowVersion.LibGitExtensions.GetBranch(IRepository repository, String name) in c:\Code\Particular\GitFlowVersion\GitFlowVersion\LibGitExtensions.cs:line 126
   --- End of inner exception stack trace ---
   at GitFlowVersion.LibGitExtensions.GetBranch(IRepository repository, String name) in c:\Code\Particular\GitFlowVersion\GitFlowVersion\LibGitExtensions.cs:line 133
   at GitFlowVersion.VersionOnMasterFinder.<VersionsOnMaster>d__3.MoveNext() in c:\Code\Particular\GitFlowVersion\GitFlowVersion\VersionOnMasterFinder.cs:line 71
   at GitFlowVersion.VersionOnMasterFinder.Execute() in c:\Code\Particular\GitFlowVersion\GitFlowVersion\VersionOnMasterFinder.cs:line 37
   at GitFlowVersion.DevelopVersionFinder.GetSemanticVersion() in c:\Code\Particular\GitFlowVersion\GitFlowVersion\BranchFinders\DevelopVersionFinder.cs:line 36
   at GitFlowVersion.DevelopVersionFinder.FindVersion() in c:\Code\Particular\GitFlowVersion\GitFlowVersion\BranchFinders\DevelopVersionFinder.cs:line 13
   at GitFlowVersion.GitFlowVersionFinder.FindVersion() in c:\Code\Particular\GitFlowVersion\GitFlowVersion\GitFlowVersionFinder.cs:line 44
   at GitFlowVersion.VersionForRepositoryFinder.GetVersion(Repository repository) in c:\Code\Particular\GitFlowVersion\GitFlowVersion\VersionForDirectoryFinder.cs:line 18
   at GitFlowVersion.VersionCache.GetVersion(String gitDirectory) in c:\Code\Particular\GitFlowVersion\GitFlowVersion\VersionCache.cs:line 39
   at GitFlowVersionTask.UpdateAssemblyInfo.Execute() in c:\Code\Particular\GitFlowVersion\GitFlowVersionTask\UpdateAssemblyInfo.cs:line 57 PlatformInstaller.CustomActions


@nulltoken do you have any info on if/when this will be supported in LibGit2Sharp?

@andreasohlund
Copy link
Contributor Author

Current workaround:


C:\dev\particular\PlatformInstaller [develop]> git checkout origin/master -b master
Checking out files: 100% (63/63), done.
Branch master set up to track remote branch master from origin.
Switched to a new branch 'master'
C:\dev\particular\PlatformInstaller [master]> git checkout develop
Switched to branch 'develop'
C:\dev\particular\PlatformInstaller [develop]>

@nulltoken
Copy link
Contributor

@nulltoken do you have any info on if/when this will be supported in LibGit2Sharp?

This is a feature we'd very much like to see supported. However, there's no timeline for this feature yet.

Some more information regarding this

  • Libgit2 relies on libssh2 which currently defers to third parties crypto API (OpenSSL, gcrypt). Dealing with such a chain of dependencies would complexify the packaging of LibGit2Sharp a bit.
  • There's an ongoing libssh2 patch that proposes to link against the Cryptography API: Next Generation. Although this is quite appealing (as it would reduce the chain of dependencies), this would also mean that users running on top of Windows 2003 Server and XP would sill not not be allowed to leverage the ssh protocol.

/cc @ethomson

@SimonCropp
Copy link
Contributor

Windows 2003 Server and XP would sill not not be allowed to leverage the ssh protocol.

this does not bother me :)

@andreasohlund
Copy link
Contributor Author

Me neither:)

Sent from my iPhone

On 21 nov 2013, at 12:06, Simon Cropp [email protected] wrote:

Windows 2003 Server and XP would sill not not be allowed to leverage the ssh protocol.

this does not bother me :)


Reply to this email directly or view it on GitHub.

@asbjornu
Copy link
Member

@andreasohlund Would you care to explain the workaround? I don't really understand where or how I can implement it.

@andreasohlund
Copy link
Contributor Author

Just fetch the master branch manually on your local machine?

@asbjornu
Copy link
Member

@andreasohlund Ah, I see. I'm not sure how I'm supposed to do that on TeamCity, though.

@andreasohlund
Copy link
Contributor Author

ah, yes that was a local workaround. On TC you have to use a https + username pwd #21 (comment)

@asbjornu
Copy link
Member

I see. Thanks!

@efunkenbusch
Copy link

Is this seriously still not supported? We don't use username/password in teamcity because our password expiration policy is draconic and it would require resetting passwords on hundreds of builds everytime they expire.

Please implement this.

@asbjornu
Copy link
Member

asbjornu commented Aug 24, 2018

@efunkenbusch: For this to be fixed, GitVersion would need to build and bundle its own version of libgit2 as per libgit2/libgit2#2600. Since we're currently just using the official LibGit2Sharp NuGet Package, this is not an easy switch. NuGet Packages of LibGit2Sharp that include SSH exist, but are not official and very out of date. If you have an idea for a sustainable and simple solution to this, we're open for pull requests.

@efunkenbusch
Copy link

@asbjornu - What about a branch that uses git command line instead? If this issue is so insurmountable, that seems like the logical conclusion.

@JakeGinnivan
Copy link
Contributor

Actually @efunkenbusch that was my idea with #1244

To introduce an in memory model which gitversion would run against then different providers could build that model. The reason I want a in memory model is many of the slow downs for gitversion can't be optimised because it just queries git whenever it needs info which apart from caching is pretty hard to fix.

@asbjornu
Copy link
Member

I believe that after upgrading to LibGit2Sharp version 0.26 in #1713, this problem should be fixed. Can you please try the latest build and report back whether it fixes this problem or not? Please reopen this issue if the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants