-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
GIT alternates not supported with version 3.4x #595
Comments
It looks like yet another storage variance with git that our new managed implementation may not yet support? |
There was some work done to support alternates, e.g. https://github.com/dotnet/Nerdbank.GitVersioning/blob/master/src/NerdBank.GitVersioning/ManagedGit/GitRepository.cs#L537-L568 (and in the constructor), but obviously it fails here. I'll try to free up some time to have a look at the open managed-git issues (this one seems easy to reproduce). (Unfortunately, freeing up time is not so easy lately). |
Understandable. I really appreciate how responsive you've been and how well you're supporting your new feature. We don't hear a lot about folks unblocked in 3.4 on various linux distros as a result of your work, but I assume that's because people mostly give feedback when something's broken rather than when it works. And I used to get a stream of complaints about various distros, and I haven't heard a peep since your work, so that's great! |
Thanks, @AArnott . I had a look at two issues which seemed straightforward (including this one). Issues like #584 and #587 will probably need more time. Do you think you could label issues related to the managed git implementation with a managed-git label or something similar? That would help me identify those. |
@AArnott By the way, from a conversation on another project:
Performance and portability seem to be a common concern for users of git-based versioning tools in the ecosystem. Glad to see nbgv making progress on both fronts! |
@Sam13 would you be willing to test @qmfrederik's fix to see if it resolves your issue? Use version 3.4.201 from here: https://dev.azure.com/andrewarnott/OSS/_packaging?_a=package&feed=PublicCI&package=Nerdbank.GitVersioning&protocolType=NuGet&version=3.4.201&view=overview Thanks. |
Still fails on Teamcity (which is using alternates):
Sidenote: When running on local machine without alternates #587 happens |
@Sam13 Thanks for testing! Could you share the contents of the alternates file on the Teamcity server? |
The content looks like that:
|
@Sam13 Hmm, now you got me confused - the TeamCity build log shows:
which made me think that was a Linux server, but Is this running WSL or something similar? |
Sorry for the confusion. |
@Sam13 I have to admit don't know much about WSL2 (assuming that's how you run your containers). I didn't expect a Windows-style path inside a Linux environment. Does |
@qmfrederik I did some more investigation by executing the following commands in my containers (docker-compose):
When I run this on a Linux host, Linux container GIT log shows commit information but NBGV fails:
When I run this on a Windows host, Linux container NBGV 3.4.201 works. (Altough GIT log fails) So for me it seems that NBGV 3.4.201 seems to fail only on Linux? |
Can you copy the output of |
|
@Sam13 Thanks, do you know whether there's a trailing |
@qmfrederik Prerelease v3.4.203 works on Linux host with Linux container! Altough GIT height is always zero (#587) |
Hi guys, the commit exists:
|
@3x0dv5 Your fetch-depth is 1: https://github.com/ruilimacom/amiliur.annotations/actions/runs/4823851800/jobs/8592878009#step:2:8 You need to set fetch-depth to 0 so that history is downloaded. |
whoops... I feel like an idiot 😄 changing the step to:
did it |
When repository is checked out with GIT alternates (e.g. as TeamCity does) NBGV get-version fails:
Nerdbank.GitVersioning.GitException: An commit object with SHA 163380e3fa79d36c0e51efc251132aa7e7f86b9d could not be found.
To reproduce:
git clone --mirror https://github.com/dotnet/Nerdbank.GitVersioning.git
git clone --shared --reference .\Nerdbank.GitVersioning.git https://github.com/dotnet/Nerdbank.GitVersioning.git test
cd test
nbgv Get-Version
I'm using NBGV v3.4.194 on Windows.
Setting NBGV_GitEngine=LibGit2 works but unfortunately not in Docker image mcr.microsoft.com/dotnet/sdk:5.0 because of dependency load problems for LibGit2.
The text was updated successfully, but these errors were encountered: