GitVersion icon indicating copy to clipboard operation
GitVersion copied to clipboard

[ISSUE]: GitVersion.MsBuild: Adding the nuget package to a SDK style project results gitversion.exe MyProj -outputfile obj\gitversion.json exited with code 1.

Open evya-dev opened this issue 1 year ago • 3 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched issues to ensure it has not already been reported

GitVersion package

GitVersion.MsBuild

GitVersion version

5.6.8-5.12.0

Operating system

Windows

What are you seeing?

When adding the nuget package for GitVersion.MsBuild into my project throws an error in the Error List Window:

Error MSB3073 The command ""\packages\gitversion.msbuild\5.6.8\tools\net48/gitversion.exe" "ProjectName" -output file -outputfile obj\gitversion.json" exited with code 1. \packages\gitversion.msbuild\5.6.8\tools\GitVersion.MsBuild.targets 9

I tried running the command through the CLI and I got the following when using version 5.6.8: unsupported repository version 1. Only version up to 0 are supported.

I tried running the same command but with the latest version 5.12.0 and I got the following error: unsupported extension name extensions.worktreeconfig

My repo is cloned from BitBucket cloud. I am using Visual Studio 2019. The project is a SDK style project with TFM of net451.

What is expected?

The gitversion.exe should support git config core.repositoryformatversion=1 and extensions.worktreeconfig=true.

Steps to Reproduce

Clone a .NET framework or .NET core project on a repo that has git config with core.repositoryformatversion=1 and extensions.worktreeconfig=true. Currently this is what my git repo has on BitBucket cloud. Open the project in Visual Studio 2019 and then add the GitVersion.MsBuild nuget package (any version from 5.6.8 to 5.12.0). Observe the error in the Error List window of the IDE.

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).

No response

evya-dev avatar Jul 05 '24 20:07 evya-dev

If I do a gitversion init I get the following (where SomeProject has a .git folder):

INFO [07/08/24 18:18:11:13] Working directory: C:\SomeProject\packages\gitversion.msbuild\5.12.0\tools\net48 unsupported extension name extensions.worktreeconfig INFO [07/08/24 18:18:11:18] Done writing

evya-dev avatar Jul 08 '24 22:07 evya-dev

This is an upstream issue in libgit2sharp library (which at the time of this comment is at version 0.3.0). libgit2sharp 0.3.0 already has support for core.repositoryformatversion=1 but does not support extensions.worktreeconfig=true.

libgit2 has added this feature (core.repositoryformatversion=1 and extensions.worktreeconfig=true): https://github.com/libgit2/libgit2/issues/6044

Next steps is to bring this downstream to libgit2Sharp and then into GitVersion.LibGit2Sharp project.

evya-dev avatar Jul 09 '24 19:07 evya-dev

The issue in libgit2Sharp has been created here: https://github.com/libgit2/libgit2sharp/issues/2109

evya-dev avatar Jul 09 '24 20:07 evya-dev

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.

github-actions[bot] avatar Oct 29 '24 11:10 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity. Thank you for your contributions

github-actions[bot] avatar Nov 28 '24 11:11 github-actions[bot]