diff --git a/.github/dependabot.yml b/.github/dependabot.yml index db3877003d..87b6a493c0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,10 +4,11 @@ updates: labels: - "dependencies" commit-message: - prefix: "(deps)" + prefix: "(sdk)" directory: "/" schedule: - interval: daily + interval: cron + cronjob: "0 12 * * *" - package-ecosystem: nuget labels: - "dependencies" @@ -18,6 +19,9 @@ updates: patterns: - "Microsoft.*" - "System.*" + Microsoft_CodeAnalysis: + patterns: + - "Microsoft.CodeAnalysis.*" analyzers: patterns: - "*Analyzers" @@ -38,7 +42,8 @@ updates: - "/new-cli" - "/src" schedule: - interval: daily + interval: cron + cronjob: "0 12 * * *" open-pull-requests-limit: 10 - package-ecosystem: github-actions @@ -52,7 +57,8 @@ updates: - "actions/*" directory: "/" schedule: - interval: daily + interval: cron + cronjob: "0 12 * * *" - package-ecosystem: npm labels: @@ -65,4 +71,5 @@ updates: - "remark*" directory: "/" schedule: - interval: monthly + interval: cron + cronjob: "0 12 1,15 * *" diff --git a/.github/workflows/qodana_analysis.yml b/.github/workflows/qodana_analysis.yml index bb02b3e74d..de9cd77019 100644 --- a/.github/workflows/qodana_analysis.yml +++ b/.github/workflows/qodana_analysis.yml @@ -26,7 +26,7 @@ jobs: global-json-file: global.json - name: 'Qodana Scan' - uses: jetbrains/qodana-action@v2025.1.0 + uses: jetbrains/qodana-action@v2025.1.1 with: args: --baseline,qodana.sarif.json cache-default-branch-only: true diff --git a/build/Directory.Packages.props b/build/Directory.Packages.props index 849085972c..9a481f2275 100644 --- a/build/Directory.Packages.props +++ b/build/Directory.Packages.props @@ -8,7 +8,7 @@ - + diff --git a/build/docker/Tasks/DockerHubReadmePublish.cs b/build/docker/Tasks/DockerHubReadmePublish.cs index 36a3b3390f..01ce452478 100644 --- a/build/docker/Tasks/DockerHubReadmePublish.cs +++ b/build/docker/Tasks/DockerHubReadmePublish.cs @@ -46,7 +46,7 @@ public override async Task RunAsync(BuildContext context) var token = context.ParseJson(response).Value("token"); settings .SetContentType("application/json") - .SetAuthorization("JWT", token) + .SetAuthorization("JWT", token!) .SetJsonRequestBody(new { full_description = readme }); }); context.Information("README.md updated on DockerHub"); diff --git a/docs/input/docs/reference/requirements.md b/docs/input/docs/reference/requirements.md index 3d950f4e6f..68acfb00d5 100644 --- a/docs/input/docs/reference/requirements.md +++ b/docs/input/docs/reference/requirements.md @@ -14,8 +14,9 @@ build server, needs to adhere to the below requirements. ### Unshallow -The repository needs to be an [unshallow][git-unshallow] clone. This means -that the `fetch-depth` in GitHub Actions needs to be set to `0`, for instance. +The repository should be an [unshallow][git-unshallow] clone. This means +that the `fetch-depth` in GitHub Actions should set to `0`, unless +the `allowshallow` flag is used. Check with your [build server][build-servers] to see how it can be configured appropriately. diff --git a/docs/input/docs/usage/cli/arguments.md b/docs/input/docs/usage/cli/arguments.md index 8b1b8ea5ea..b503a1f899 100644 --- a/docs/input/docs/usage/cli/arguments.md +++ b/docs/input/docs/usage/cli/arguments.md @@ -50,6 +50,10 @@ GitVersion [path] Currently supported config overrides: tag-prefix /nocache Bypasses the cache, result will not be written to the cache. /nonormalize Disables normalize step on a build server. + /allowshallow Allows GitVersion to run on a shallow clone. + This is not recommended, but can be used if you are sure + that the shallow clone contains all the information needed + to calculate the version. /verbosity Specifies the amount of information to be displayed. (Quiet, Minimal, Normal, Verbose, Diagnostic) Default is Normal diff --git a/docs/input/docs/usage/msbuild.md b/docs/input/docs/usage/msbuild.md index 9d812f6a80..5b3c258173 100644 --- a/docs/input/docs/usage/msbuild.md +++ b/docs/input/docs/usage/msbuild.md @@ -18,8 +18,8 @@ version information that is compiled into the resulting artifact. Since version 6.0 only MSBuild running on .NET Core (`dotnet msbuild`) is supported. Unfortunately, up until at least Visual Studio 2022 17.11, Visual Studio runs all builds -using the .NET Framework version of MSBuild, and therefore **Visual Studio is not supported**. -For more information see [this discussion](https://github.com/GitTools/GitVersion/discussions/4130). +using the .NET Framework version of MSBuild, and therefore **Visual Studio is not supported**. +For more information see [this discussion](https://github.com/GitTools/GitVersion/discussions/4130). ## TL;DR @@ -261,7 +261,9 @@ There are properties that correspond to certain In particular, setting `GitVersion_NoFetchEnabled` to `true` disables `git fetch` during version calculation, setting `GitVersion_NoNormalizeEnabled` to `true` disables normalize step on a build server, setting `GitVersion_NoCacheEnabled` to `true` -makes GetVersion ignore cache. All the rest command line arguments can be passed via +makes GetVersion ignore cache, setting `GitVersion_AllowShallowEnabled` to `true` +does not mandate a full clone of the repository to determine the version. +All the rest command line arguments can be passed via `GitVersion_CommandLineArguments` variable. ## My Git repository requires authentication. What should I do? diff --git a/global.json b/global.json index dfbf12676d..555ee4e443 100644 --- a/global.json +++ b/global.json @@ -5,6 +5,6 @@ "src" ], "sdk": { - "version": "9.0.203" + "version": "9.0.301" } } diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index 747f4524bc..4e05e8cc7a 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -5,23 +5,23 @@ - - - + + + - - + + - + - + - + - + - \ No newline at end of file + diff --git a/package-lock.json b/package-lock.json index 526220b2ba..b2349ae19b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14143,9 +14143,9 @@ } }, "node_modules/undici": { - "version": "6.21.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.1.tgz", - "integrity": "sha512-q/1rj5D0/zayJB2FraXdaWxbhWiNKDvu8naDT2dl1yTlvJp4BLtOcp2a5BvgGNQpYYJzau7tf1WgKv3b+7mqpQ==", + "version": "6.21.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.3.tgz", + "integrity": "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==", "dev": true, "license": "MIT", "engines": { @@ -25953,9 +25953,9 @@ } }, "undici": { - "version": "6.21.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.1.tgz", - "integrity": "sha512-q/1rj5D0/zayJB2FraXdaWxbhWiNKDvu8naDT2dl1yTlvJp4BLtOcp2a5BvgGNQpYYJzau7tf1WgKv3b+7mqpQ==", + "version": "6.21.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.3.tgz", + "integrity": "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==", "dev": true }, "unified-args": { diff --git a/schemas/6.3/GitVersion.configuration.json b/schemas/6.3/GitVersion.configuration.json new file mode 100644 index 0000000000..9681e070f1 --- /dev/null +++ b/schemas/6.3/GitVersion.configuration.json @@ -0,0 +1,426 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://gitversion.net/schemas/6.3/GitVersion.configuration.json", + "title": "GitVersion Configuration (6.3)", + "description": "GitVersion configuration schema (6.3)", + "type": "object", + "properties": { + "assembly-file-versioning-format": { + "description": "Specifies the format of AssemblyFileVersion and overwrites the value of assembly-file-versioning-scheme.", + "type": [ + "string", + "null" + ] + }, + "assembly-file-versioning-scheme": { + "description": "The scheme to use when setting AssemblyFileVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to 'MajorMinorPatch'.", + "default": "MajorMinorPatch", + "enum": [ + "MajorMinorPatchTag", + "MajorMinorPatch", + "MajorMinor", + "Major", + "None", + null + ] + }, + "assembly-informational-format": { + "description": "Specifies the format of AssemblyInformationalVersion. Defaults to '{InformationalVersion}'.", + "default": "'{InformationalVersion}'", + "type": [ + "string", + "null" + ] + }, + "assembly-versioning-format": { + "description": "Specifies the format of AssemblyVersion and overwrites the value of assembly-versioning-scheme.", + "type": [ + "string", + "null" + ] + }, + "assembly-versioning-scheme": { + "description": "The scheme to use when setting AssemblyVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to 'MajorMinorPatch'.", + "default": "MajorMinorPatch", + "enum": [ + "MajorMinorPatchTag", + "MajorMinorPatch", + "MajorMinor", + "Major", + "None", + null + ] + }, + "branches": { + "description": "The header for all the individual branch configuration.", + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "commit-message-incrementing": { + "description": "Sets whether it should be possible to increment the version with special syntax in the commit message. Can be 'Disabled', 'Enabled' or 'MergeMessageOnly'.", + "enum": [ + "Enabled", + "Disabled", + "MergeMessageOnly", + null + ] + }, + "mode": { + "description": "The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.", + "enum": [ + "ManualDeployment", + "ContinuousDelivery", + "ContinuousDeployment", + null + ] + }, + "increment": { + "description": "The increment strategy for this branch. Can be 'Inherit', 'Patch', 'Minor', 'Major', 'None'.", + "$ref": "#/$defs/incrementStrategy" + }, + "is-main-branch": { + "description": "When using Mainline mode, this indicates that this branch is a mainline. By default main and support/* are mainlines.", + "type": [ + "boolean", + "null" + ] + }, + "is-release-branch": { + "description": "Indicates this branch configuration represents a release branch in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "is-source-branch-for": { + "description": "The branches that this branch is a source branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "label": { + "description": "The label to use for this branch. Use the value {BranchName} or similar as a placeholder to insert a named capture group from RegularExpression (fx. the branch name).", + "type": [ + "string", + "null" + ] + }, + "pre-release-weight": { + "description": "Provides a way to translate the PreReleaseLabel to a number.", + "type": [ + "integer", + "null" + ] + }, + "prevent-increment": { + "description": "The prevent increment configuration section.", + "$ref": "#/$defs/preventIncrementConfiguration" + }, + "regex": { + "format": "regex", + "description": "The regular expression pattern to use to match this branch.", + "type": [ + "string", + "null" + ] + }, + "source-branches": { + "description": "The source branches for this branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "track-merge-message": { + "description": "This property is a branch related property and gives the user the possibility to control the behavior of whether the merge commit message will be interpreted as a next version or not.", + "type": [ + "boolean", + "null" + ] + }, + "track-merge-target": { + "description": "Strategy which will look for tagged merge commits directly off the current branch.", + "type": [ + "boolean", + "null" + ] + }, + "tracks-release-branches": { + "description": "Indicates this branch configuration represents develop in GitFlow.", + "type": [ + "boolean", + "null" + ] + } + } + } + }, + "commit-date-format": { + "description": "The format to use when calculating the commit date. Defaults to 'yyyy-MM-dd'. See [Standard Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings) and [Custom Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings).", + "default": "yyyy-MM-dd", + "type": [ + "string", + "null" + ] + }, + "commit-message-incrementing": { + "description": "Sets whether it should be possible to increment the version with special syntax in the commit message. Can be 'Disabled', 'Enabled' or 'MergeMessageOnly'.", + "enum": [ + "Enabled", + "Disabled", + "MergeMessageOnly", + null + ] + }, + "mode": { + "description": "The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.", + "enum": [ + "ManualDeployment", + "ContinuousDelivery", + "ContinuousDeployment", + null + ] + }, + "ignore": { + "description": "The header property for the ignore configuration.", + "type": "object", + "properties": { + "commits-before": { + "format": "date-time", + "description": "Commits before this date will be ignored. Format: yyyy-MM-ddTHH:mm:ss.", + "type": [ + "string", + "null" + ] + }, + "sha": { + "description": "A sequence of SHAs to be excluded from the version calculations.", + "$ref": "#/$defs/hashSetOfString" + } + } + }, + "increment": { + "description": "The increment strategy for this branch. Can be 'Inherit', 'Patch', 'Minor', 'Major', 'None'.", + "$ref": "#/$defs/incrementStrategy" + }, + "is-main-branch": { + "description": "When using Mainline mode, this indicates that this branch is a mainline. By default main and support/* are mainlines.", + "type": [ + "boolean", + "null" + ] + }, + "is-release-branch": { + "description": "Indicates this branch configuration represents a release branch in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "is-source-branch-for": { + "description": "The branches that this branch is a source branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "label": { + "description": "The label to use for this branch. Use the value {BranchName} or similar as a placeholder to insert a named capture group from RegularExpression (fx. the branch name).", + "type": [ + "string", + "null" + ] + }, + "major-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a major version increment. Defaults to '\\+semver:\\s?(breaking|major)'", + "default": "\\+semver:\\s?(breaking|major)", + "type": [ + "string", + "null" + ] + }, + "merge-message-formats": { + "description": "Custom merge message formats to enable identification of merge messages that do not follow the built-in conventions.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "minor-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a minor version increment. Defaults to '\\+semver:\\s?(feature|minor)'", + "default": "\\+semver:\\s?(feature|minor)", + "type": [ + "string", + "null" + ] + }, + "next-version": { + "description": "Allows you to bump the next version explicitly. Useful for bumping main or a feature branch with breaking changes", + "type": [ + "string", + "null" + ] + }, + "no-bump-message": { + "format": "regex", + "description": "Used to tell GitVersion not to increment when in Mainline development mode. Defaults to '\\+semver:\\s?(none|skip)'", + "default": "\\+semver:\\s?(none|skip)", + "type": [ + "string", + "null" + ] + }, + "patch-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a patch version increment. Defaults to '\\+semver:\\s?(fix|patch)'", + "default": "\\+semver:\\s?(fix|patch)", + "type": [ + "string", + "null" + ] + }, + "pre-release-weight": { + "description": "Provides a way to translate the PreReleaseLabel to a number.", + "type": [ + "integer", + "null" + ] + }, + "prevent-increment": { + "description": "The prevent increment configuration section.", + "$ref": "#/$defs/preventIncrementConfiguration" + }, + "regex": { + "format": "regex", + "description": "The regular expression pattern to use to match this branch.", + "type": [ + "string", + "null" + ] + }, + "semantic-version-format": { + "description": "Specifies the semantic version format that is used when parsing the string. Can be 'Strict' or 'Loose'. Defaults to 'Strict'.", + "default": "Strict", + "enum": [ + "Strict", + "Loose" + ] + }, + "source-branches": { + "description": "The source branches for this branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "tag-prefix": { + "format": "regex", + "description": "A regular expression which is used to trim Git tags before processing. Defaults to '[vV]?'", + "default": "[vV]?", + "type": [ + "string", + "null" + ] + }, + "tag-pre-release-weight": { + "description": "The pre-release weight in case of tagged commits. Defaults to 60000.", + "type": [ + "integer", + "null" + ] + }, + "track-merge-message": { + "description": "This property is a branch related property and gives the user the possibility to control the behavior of whether the merge commit message will be interpreted as a next version or not.", + "type": [ + "boolean", + "null" + ] + }, + "track-merge-target": { + "description": "Strategy which will look for tagged merge commits directly off the current branch.", + "type": [ + "boolean", + "null" + ] + }, + "tracks-release-branches": { + "description": "Indicates this branch configuration represents develop in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "update-build-number": { + "description": "Whether to update the build number in the project file. Defaults to true.", + "default": "true", + "type": "boolean" + }, + "version-in-branch-pattern": { + "format": "regex", + "description": "A regular expression which is used to determine the version number in the branch name or commit message (e.g., v1.0.0-LTS). Defaults to '(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*'.", + "default": "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*", + "type": [ + "string", + "null" + ] + }, + "strategies": { + "description": "Specifies which version strategies (one or more) will be used to determine the next version. Following values are available: 'ConfiguredNextVersion', 'MergeMessage', 'TaggedCommit', 'TrackReleaseBranches', 'VersionInBranchName' and 'Mainline'.", + "type": "array", + "items": { + "enum": [ + "None", + "Fallback", + "ConfiguredNextVersion", + "MergeMessage", + "TaggedCommit", + "TrackReleaseBranches", + "VersionInBranchName", + "Mainline" + ] + } + }, + "workflow": { + "description": "The base template of the configuration to use. Possible values are: 'GitFlow/v1' or 'GitHubFlow/v1'", + "type": [ + "string", + "null" + ] + } + }, + "$defs": { + "incrementStrategy": { + "enum": [ + "None", + "Major", + "Minor", + "Patch", + "Inherit" + ] + }, + "hashSetOfString": { + "type": "array", + "items": { + "type": "string" + } + }, + "preventIncrementConfiguration": { + "type": "object", + "properties": { + "of-merged-branch": { + "description": "Prevent increment when branch merged.", + "type": [ + "boolean", + "null" + ] + }, + "when-branch-merged": { + "description": "Prevent increment when branch merged.", + "type": [ + "boolean", + "null" + ] + }, + "when-current-commit-tagged": { + "description": "This branch related property controls the behavior whether to use the tagged (value set to true) or the incremented (value set to false) semantic version. Defaults to true.", + "type": [ + "boolean", + "null" + ] + } + } + } + } +} \ No newline at end of file diff --git a/schemas/6.3/GitVersion.json b/schemas/6.3/GitVersion.json new file mode 100644 index 0000000000..80cd006aec --- /dev/null +++ b/schemas/6.3/GitVersion.json @@ -0,0 +1,184 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://gitversion.net/schemas/6.3/GitVersion.json", + "title": "GitVersion version variables output", + "description": "GitVersion output schema", + "type": "object", + "properties": { + "AssemblySemFileVer": { + "description": "Suitable for .NET AssemblyFileVersion. Defaults to Major.Minor.Patch.0.", + "type": [ + "string", + "null" + ] + }, + "AssemblySemVer": { + "description": "Suitable for .NET AssemblyVersion. Defaults to Major.Minor.0.0", + "type": [ + "string", + "null" + ] + }, + "BranchName": { + "description": "The name of the checked out Git branch.", + "type": [ + "string", + "null" + ] + }, + "BuildMetaData": { + "description": "The build metadata, usually representing number of commits since the VersionSourceSha.", + "type": [ + "integer", + "null" + ] + }, + "CommitDate": { + "description": "The ISO-8601 formatted date of the commit identified by Sha.", + "type": [ + "string", + "null" + ] + }, + "CommitsSinceVersionSource": { + "description": "The number of commits since the version source.", + "type": [ + "integer", + "null" + ] + }, + "EscapedBranchName": { + "description": "Equal to BranchName, but with / replaced with -.", + "type": [ + "string", + "null" + ] + }, + "FullBuildMetaData": { + "description": "The BuildMetaData suffixed with BranchName and Sha.", + "type": [ + "string", + "null" + ] + }, + "FullSemVer": { + "description": "The full, SemVer 2.0 compliant version number.", + "type": [ + "string", + "null" + ] + }, + "InformationalVersion": { + "description": "Suitable for .NET AssemblyInformationalVersion. Defaults to FullSemVer suffixed by FullBuildMetaData.", + "type": [ + "string", + "null" + ] + }, + "Major": { + "description": "The major version. Should be incremented on breaking changes.", + "type": [ + "integer", + "null" + ] + }, + "MajorMinorPatch": { + "description": "Major, Minor and Patch joined together, separated by '.'.", + "type": [ + "string", + "null" + ] + }, + "Minor": { + "description": "The minor version. Should be incremented on new features.", + "type": [ + "integer", + "null" + ] + }, + "Patch": { + "description": "The patch version. Should be incremented on bug fixes.", + "type": [ + "integer", + "null" + ] + }, + "PreReleaseLabel": { + "description": "The pre-release label is the name of the pre-release.", + "type": [ + "string", + "null" + ] + }, + "PreReleaseLabelWithDash": { + "description": "The pre-release label prefixed with a dash.", + "type": [ + "string", + "null" + ] + }, + "PreReleaseNumber": { + "description": "The pre-release number is the number of commits since the last version bump.", + "type": [ + "integer", + "null" + ] + }, + "PreReleaseTag": { + "description": "The pre-release tag is the pre-release label suffixed by the PreReleaseNumber.", + "type": [ + "string", + "null" + ] + }, + "PreReleaseTagWithDash": { + "description": "The pre-release tag prefixed with a dash.", + "type": [ + "string", + "null" + ] + }, + "SemVer": { + "description": "The semantic version number, including PreReleaseTagWithDash for pre-release version numbers.", + "type": [ + "string", + "null" + ] + }, + "Sha": { + "description": "The SHA of the Git commit.", + "type": [ + "string", + "null" + ] + }, + "ShortSha": { + "description": "The Sha limited to 7 characters.", + "type": [ + "string", + "null" + ] + }, + "UncommittedChanges": { + "description": "The number of uncommitted changes present in the repository.", + "type": [ + "integer", + "null" + ] + }, + "VersionSourceSha": { + "description": "The SHA of the commit used as version source.", + "type": [ + "string", + "null" + ] + }, + "WeightedPreReleaseNumber": { + "description": "A summation of branch specific pre-release-weight and the PreReleaseNumber. Can be used to obtain a monotonically increasing version number across the branches.", + "type": [ + "integer", + "null" + ] + } + } +} \ No newline at end of file diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 9de153e620..38549fa504 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -7,43 +7,43 @@ - - - - + + + + - - + + - + - + - + - - - - - - + + + + + + - + - + - - + + - \ No newline at end of file + diff --git a/src/GitVersion.App.Tests/ArgumentParserTests.cs b/src/GitVersion.App.Tests/ArgumentParserTests.cs index 5e53ac63a0..42e7c36304 100644 --- a/src/GitVersion.App.Tests/ArgumentParserTests.cs +++ b/src/GitVersion.App.Tests/ArgumentParserTests.cs @@ -629,6 +629,13 @@ public void NoNormalizeTrueWhenDefined() arguments.NoNormalize.ShouldBe(true); } + [Test] + public void AllowshallowTrueWhenDefined() + { + var arguments = this.argumentParser.ParseArguments("-allowshallow"); + arguments.AllowShallow.ShouldBe(true); + } + [Test] public void OtherArgumentsCanBeParsedBeforeNofetch() { @@ -653,18 +660,45 @@ public void OtherArgumentsCanBeParsedBeforeNocache() arguments.NoCache.ShouldBe(true); } - [TestCase("-nofetch -nonormalize -nocache")] - [TestCase("-nofetch -nocache -nonormalize")] - [TestCase("-nocache -nofetch -nonormalize")] - [TestCase("-nocache -nonormalize -nofetch")] - [TestCase("-nonormalize -nocache -nofetch")] - [TestCase("-nonormalize -nofetch -nocache")] + [Test] + public void OtherArgumentsCanBeParsedBeforeAllowshallow() + { + var arguments = this.argumentParser.ParseArguments("targetpath -allowshallow"); + arguments.TargetPath.ShouldBe("targetpath"); + arguments.AllowShallow.ShouldBe(true); + } + + [TestCase("-nofetch -nonormalize -nocache -allowshallow")] + [TestCase("-nofetch -nonormalize -allowshallow -nocache")] + [TestCase("-nofetch -nocache -nonormalize -allowshallow")] + [TestCase("-nofetch -nocache -allowshallow -nonormalize")] + [TestCase("-nofetch -allowshallow -nonormalize -nocache")] + [TestCase("-nofetch -allowshallow -nocache -nonormalize")] + [TestCase("-nonormalize -nofetch -nocache -allowshallow")] + [TestCase("-nonormalize -nofetch -allowshallow -nocache")] + [TestCase("-nonormalize -nocache -nofetch -allowshallow")] + [TestCase("-nonormalize -nocache -allowshallow -nofetch")] + [TestCase("-nonormalize -allowshallow -nofetch -nocache")] + [TestCase("-nonormalize -allowshallow -nocache -nofetch")] + [TestCase("-nocache -nofetch -nonormalize -allowshallow")] + [TestCase("-nocache -nofetch -allowshallow -nonormalize")] + [TestCase("-nocache -nonormalize -nofetch -allowshallow")] + [TestCase("-nocache -nonormalize -allowshallow -nofetch")] + [TestCase("-nocache -allowshallow -nofetch -nonormalize")] + [TestCase("-nocache -allowshallow -nonormalize -nofetch")] + [TestCase("-allowshallow -nofetch -nonormalize -nocache")] + [TestCase("-allowshallow -nofetch -nocache -nonormalize")] + [TestCase("-allowshallow -nonormalize -nofetch -nocache")] + [TestCase("-allowshallow -nonormalize -nocache -nofetch")] + [TestCase("-allowshallow -nocache -nofetch -nonormalize")] + [TestCase("-allowshallow -nocache -nonormalize -nofetch")] public void SeveralSwitchesCanBeParsed(string commandLineArgs) { var arguments = this.argumentParser.ParseArguments(commandLineArgs); arguments.NoCache.ShouldBe(true); arguments.NoNormalize.ShouldBe(true); arguments.NoFetch.ShouldBe(true); + arguments.AllowShallow.ShouldBe(true); } [Test] diff --git a/src/GitVersion.App.Tests/HelpWriterTests.cs b/src/GitVersion.App.Tests/HelpWriterTests.cs index 785f7a8ef6..9005872c44 100644 --- a/src/GitVersion.App.Tests/HelpWriterTests.cs +++ b/src/GitVersion.App.Tests/HelpWriterTests.cs @@ -19,21 +19,34 @@ public void AllArgsAreInHelp() { var lookup = new Dictionary { + { nameof(Arguments.IsHelp), "/?" }, + { nameof(Arguments.IsVersion), "/version" }, + { nameof(Arguments.TargetUrl), "/url" }, { nameof(Arguments.TargetBranch), "/b" }, + { nameof(Arguments.ClonePath), "/dynamicRepoLocation" }, + { nameof(Arguments.CommitId), "/c" }, + { nameof(Arguments.LogFilePath) , "/l" }, + { nameof(Arguments.Verbosity), "/verbosity" }, + { nameof(Arguments.Output) , "/output" }, { nameof(Arguments.OutputFile) , "/outputfile" }, - { nameof(Arguments.ClonePath), "/dynamicRepoLocation" }, - { nameof(Arguments.IsHelp), "/?" }, - { nameof(Arguments.IsVersion), "/version" }, + { nameof(Arguments.ShowVariable), "/showvariable" }, + { nameof(Arguments.Format), "/format" }, + { nameof(Arguments.UpdateWixVersionFile), "/updatewixversionfile" }, + { nameof(Arguments.UpdateProjectFiles), "/updateprojectfiles" }, + { nameof(Arguments.UpdateAssemblyInfo), "/updateassemblyinfo" }, + { nameof(Arguments.EnsureAssemblyInfo), "/ensureassemblyinfo" }, + { nameof(Arguments.ConfigurationFile), "/config" }, - { nameof(Arguments.Verbosity), "/verbosity" }, - { nameof(Arguments.CommitId), "/c" }, { nameof(Arguments.ShowConfiguration), "/showconfig" }, { nameof(Arguments.OverrideConfiguration), "/overrideconfig" }, - { nameof(Arguments.ShowVariable), "/showvariable" }, - { nameof(Arguments.Format), "/format" } + + { nameof(Arguments.NoCache), "/nocache" }, + { nameof(Arguments.NoFetch), "/nofetch" }, + { nameof(Arguments.NoNormalize), "/nonormalize" }, + { nameof(Arguments.AllowShallow), "/allowshallow" }, }; var helpText = string.Empty; @@ -42,7 +55,7 @@ public void AllArgsAreInHelp() var ignored = new[] { nameof(Arguments.Authentication), - nameof(Arguments.UpdateAssemblyInfoFileName) + nameof(Arguments.UpdateAssemblyInfoFileName), }; typeof(Arguments).GetFields() .Select(p => p.Name) diff --git a/src/GitVersion.App/ArgumentParser.cs b/src/GitVersion.App/ArgumentParser.cs index d22b63ee31..1f85a1b3d2 100644 --- a/src/GitVersion.App/ArgumentParser.cs +++ b/src/GitVersion.App/ArgumentParser.cs @@ -281,6 +281,12 @@ private static bool ParseSwitches(Arguments arguments, string? name, IReadOnlyLi return true; } + if (name.IsSwitch("allowshallow")) + { + arguments.AllowShallow = true; + return true; + } + if (name.IsSwitch("verbosity")) { ParseVerbosity(arguments, value); diff --git a/src/GitVersion.App/ArgumentParserExtensions.cs b/src/GitVersion.App/ArgumentParserExtensions.cs index 493052fa06..7a5bbfb006 100644 --- a/src/GitVersion.App/ArgumentParserExtensions.cs +++ b/src/GitVersion.App/ArgumentParserExtensions.cs @@ -69,7 +69,7 @@ public static bool IsSwitch(this string? value, string switchName) public static bool ArgumentRequiresValue(this string argument, int argumentIndex) { - var booleanArguments = new[] { "updateassemblyinfo", "ensureassemblyinfo", "nofetch", "nonormalize", "nocache" }; + var booleanArguments = new[] { "updateassemblyinfo", "ensureassemblyinfo", "nofetch", "nonormalize", "nocache", "allowshallow" }; var argumentMightRequireValue = !booleanArguments.Contains(argument[1..], StringComparer.OrdinalIgnoreCase); diff --git a/src/GitVersion.App/Arguments.cs b/src/GitVersion.App/Arguments.cs index 8f5f977a67..ee8b86a85c 100644 --- a/src/GitVersion.App/Arguments.cs +++ b/src/GitVersion.App/Arguments.cs @@ -13,8 +13,6 @@ internal class Arguments public string? TargetPath; - public bool UpdateWixVersionFile; - public string? TargetUrl; public string? TargetBranch; public string? CommitId; @@ -27,6 +25,7 @@ internal class Arguments public bool NoFetch; public bool NoCache; public bool NoNormalize; + public bool AllowShallow; public string? LogFilePath; public string? ShowVariable; @@ -35,6 +34,7 @@ internal class Arguments public ISet Output = new HashSet(); public Verbosity Verbosity = Verbosity.Normal; + public bool UpdateWixVersionFile; public bool UpdateProjectFiles; public bool UpdateAssemblyInfo; public bool EnsureAssemblyInfo; @@ -78,7 +78,8 @@ public GitVersionOptions ToOptions() { NoFetch = NoFetch, NoCache = NoCache, - NoNormalize = NoNormalize + NoNormalize = NoNormalize, + AllowShallow = AllowShallow, }, WixInfo = diff --git a/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs b/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs index 77521b0fcf..0852be5681 100644 --- a/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs +++ b/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs @@ -597,6 +597,79 @@ public void CalculateVersionVariables_ShallowFetch_ThrowException() exception?.Message.ShouldBe("Repository is a shallow clone. Git repositories must contain the full history. See https://gitversion.net/docs/reference/requirements#unshallow for more info."); } + [Test] + public void CalculateVersionVariables_ShallowFetch_WithAllowShallow_ShouldNotThrowException() + { + // Setup + using var fixture = new RemoteRepositoryFixture(); + fixture.LocalRepositoryFixture.MakeShallow(); + + using var worktreeFixture = new LocalRepositoryFixture(new(fixture.LocalRepositoryFixture.RepositoryPath)); + var gitVersionOptions = new GitVersionOptions + { + WorkingDirectory = worktreeFixture.RepositoryPath, + Settings = { AllowShallow = true } + }; + + var environment = new TestEnvironment(); + environment.SetEnvironmentVariable(AzurePipelines.EnvironmentVariableName, "true"); + + this.sp = GetServiceProvider(gitVersionOptions, environment: environment); + + sp.DiscoverRepository(); + + var sut = sp.GetRequiredService(); + + // Execute + var version = sut.CalculateVersionVariables(); + + // Verify + version.ShouldNotBeNull(); + var commits = worktreeFixture.Repository.Head.Commits; + version.Sha.ShouldBe(commits.First().Sha); + } + + [Test] + public void CalculateVersionVariables_WithLimitedCloneDepth_AndAllowShallowTrue_ShouldCalculateVersionCorrectly() + { + // Setup + using var fixture = new RemoteRepositoryFixture(); + fixture.LocalRepositoryFixture.MakeShallow(); + + fixture.LocalRepositoryFixture.Repository.MakeACommit("Initial commit"); + fixture.LocalRepositoryFixture.Repository.MakeATaggedCommit("1.0.0"); + var latestCommit = fixture.LocalRepositoryFixture.Repository.MakeACommit("+semver:major"); + + using var worktreeFixture = new LocalRepositoryFixture(new(fixture.LocalRepositoryFixture.RepositoryPath)); + + var gitVersionOptions = new GitVersionOptions + { + WorkingDirectory = worktreeFixture.RepositoryPath, + Settings = { AllowShallow = true } + }; + + var environment = new TestEnvironment(); + environment.SetEnvironmentVariable(AzurePipelines.EnvironmentVariableName, "true"); + + this.sp = GetServiceProvider(gitVersionOptions, environment: environment); + sp.DiscoverRepository(); + var sut = sp.GetRequiredService(); + + // Execute + var version = sut.CalculateVersionVariables(); + + // Verify + version.ShouldNotBeNull(); + + // Verify that the correct commit is used + version.Sha.ShouldBe(latestCommit.Sha); + version.MajorMinorPatch.ShouldBe("2.0.0"); + + // Verify repository is still recognized as shallow + var repository = this.sp.GetRequiredService(); + repository.IsShallow.ShouldBeTrue("Repository should still be shallow after version calculation"); + } + private string GetWorktreePath(EmptyRepositoryFixture fixture) { var worktreePath = FileSystemHelper.Path.Combine(this.fileSystem.Directory.GetParent(fixture.RepositoryPath)?.FullName, Guid.NewGuid().ToString()); diff --git a/src/GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs b/src/GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs index b9982f9d47..1570e7bf58 100644 --- a/src/GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs +++ b/src/GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs @@ -65,6 +65,21 @@ public static void DumpGraph(this IGitRepository repository, Action? wri public static void DumpGraph(this IRepository repository, Action? writer = null, int? maxCommits = null) => DumpGraph(repository.ToGitRepository().Path, writer, maxCommits); + public static void RenameRemote(this LibGit2Sharp.RemoteCollection remotes, string oldName, string newName) + { + if (oldName.IsEquivalentTo(newName)) return; + if (remotes.Any(remote => remote.Name == newName)) + { + throw new InvalidOperationException($"A remote with the name '{newName}' already exists."); + } + if (!remotes.Any(remote => remote.Name == oldName)) + { + throw new InvalidOperationException($"A remote with the name '{oldName}' does not exist."); + } + remotes.Add(newName, remotes[oldName].Url); + remotes.Remove(oldName); + } + public static GitVersionVariables GetVersion(this RepositoryFixtureBase fixture, IGitVersionConfiguration? configuration = null, IRepository? repository = null, string? commitId = null, bool onlyTrackedBranches = true, string? targetBranch = null) { diff --git a/src/GitVersion.Core.Tests/IntegrationTests/RemoteRepositoryScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/RemoteRepositoryScenarios.cs index e2720e37da..af76ec7acd 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/RemoteRepositoryScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/RemoteRepositoryScenarios.cs @@ -142,17 +142,12 @@ private static void CopyRemoteBranchesToHeads(Repository repository) [TestCase("custom", "release/3.0.0", "0.1.0-alpha.5")] public void EnsureRemoteReleaseBranchesAreTracked(string origin, string branchName, string expectedVersion) { - if (SysEnv.OSVersion.Platform == PlatformID.Win32NT) - { - Assert.Ignore("Test ignored on Windows - LibGitSharp 0.31.0 fails"); - } - using var fixture = new RemoteRepositoryFixture("develop"); fixture.CreateBranch(branchName); fixture.MakeACommit(); - if (origin != "origin") fixture.LocalRepositoryFixture.Repository.Network.Remotes.Rename("origin", origin); + if (origin != "origin") fixture.LocalRepositoryFixture.Repository.Network.Remotes.RenameRemote("origin", origin); fixture.LocalRepositoryFixture.Fetch(origin); fixture.LocalRepositoryFixture.Checkout("develop"); diff --git a/src/GitVersion.Core.Tests/IntegrationTests/VersionInCurrentBranchNameScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/VersionInCurrentBranchNameScenarios.cs index 51548c6cf8..387559ff4e 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/VersionInCurrentBranchNameScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/VersionInCurrentBranchNameScenarios.cs @@ -54,12 +54,8 @@ public void TakesVersionFromNameOfRemoteReleaseBranchInOrigin() [Test] public void DoesNotTakeVersionFromNameOfRemoteReleaseBranchInCustomRemote() { - if (SysEnv.OSVersion.Platform == PlatformID.Win32NT) - { - Assert.Ignore("Test ignored on Windows - LibGitSharp 0.31.0 fails"); - } using var fixture = new RemoteRepositoryFixture(); - fixture.LocalRepositoryFixture.Repository.Network.Remotes.Rename("origin", "upstream"); + fixture.LocalRepositoryFixture.Repository.Network.Remotes.RenameRemote("origin", "upstream"); fixture.BranchTo("release/2.0.0"); fixture.MakeACommit(); Commands.Fetch(fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, [], new(), null); diff --git a/src/GitVersion.Core.Tests/IntegrationTests/VersionInMergedBranchNameScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/VersionInMergedBranchNameScenarios.cs index a36baccecc..8da8e0ce2c 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/VersionInMergedBranchNameScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/VersionInMergedBranchNameScenarios.cs @@ -70,12 +70,8 @@ public void TakesVersionFromNameOfRemoteReleaseBranchInOrigin() [Test] public void DoesNotTakeVersionFromNameOfRemoteReleaseBranchInCustomRemote() { - if (SysEnv.OSVersion.Platform == PlatformID.Win32NT) - { - Assert.Ignore("Test ignored on Windows - LibGitSharp 0.31.0 fails"); - } using var fixture = new RemoteRepositoryFixture(); - fixture.LocalRepositoryFixture.Repository.Network.Remotes.Rename("origin", "upstream"); + fixture.LocalRepositoryFixture.Repository.Network.Remotes.RenameRemote("origin", "upstream"); fixture.BranchTo("release/2.0.0"); fixture.MakeACommit(); fixture.LocalRepositoryFixture.Fetch("upstream"); diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Strategies/VersionInBranchNameBaseVersionStrategyTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/Strategies/VersionInBranchNameBaseVersionStrategyTests.cs index 4d53a8b07c..868baca593 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Strategies/VersionInBranchNameBaseVersionStrategyTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/Strategies/VersionInBranchNameBaseVersionStrategyTests.cs @@ -98,14 +98,10 @@ public void CanTakeVersionFromNameOfConfiguredReleaseBranch(string branchName, s [TestCase("origin", "release/3.0.0", "3.0.0")] public void CanTakeVersionFromNameOfRemoteReleaseBranch(string origin, string branchName, string expectedBaseVersion) { - if (SysEnv.OSVersion.Platform == PlatformID.Win32NT) - { - Assert.Ignore("Test ignored on Windows - LibGitSharp 0.31.0 fails"); - } using var fixture = new RemoteRepositoryFixture(); fixture.CreateBranch(branchName); - if (origin != "origin") fixture.LocalRepositoryFixture.Repository.Network.Remotes.Rename("origin", origin); + if (origin != "origin") fixture.LocalRepositoryFixture.Repository.Network.Remotes.RenameRemote("origin", origin); fixture.LocalRepositoryFixture.Fetch(origin); var localRepository = fixture.LocalRepositoryFixture.Repository.ToGitRepository(); diff --git a/src/GitVersion.Core/Core/GitPreparer.cs b/src/GitVersion.Core/Core/GitPreparer.cs index adcad5de05..77f6b27346 100644 --- a/src/GitVersion.Core/Core/GitPreparer.cs +++ b/src/GitVersion.Core/Core/GitPreparer.cs @@ -190,7 +190,14 @@ private void NormalizeGitDirectory(bool noFetch, string? currentBranchName, bool if (this.repository.IsShallow) { - throw new WarningException("Repository is a shallow clone. Git repositories must contain the full history. See https://gitversion.net/docs/reference/requirements#unshallow for more info."); + if (this.options.Value.Settings.AllowShallow) + { + this.log.Info("Repository is a shallow clone. GitVersion will continue, but it is recommended to use a full clone for accurate versioning."); + } + else + { + throw new WarningException("Repository is a shallow clone. Git repositories must contain the full history. See https://gitversion.net/docs/reference/requirements#unshallow for more info."); + } } } diff --git a/src/GitVersion.Core/Options/Settings.cs b/src/GitVersion.Core/Options/Settings.cs index 58ded50c19..cbb9dabc8c 100644 --- a/src/GitVersion.Core/Options/Settings.cs +++ b/src/GitVersion.Core/Options/Settings.cs @@ -6,4 +6,5 @@ public record Settings public bool NoCache; public bool NoNormalize; public bool OnlyTrackedBranches = false; + public bool AllowShallow = false; } diff --git a/src/GitVersion.Core/PublicAPI.Shipped.txt b/src/GitVersion.Core/PublicAPI.Shipped.txt index 38ca63906a..27793f8f08 100644 --- a/src/GitVersion.Core/PublicAPI.Shipped.txt +++ b/src/GitVersion.Core/PublicAPI.Shipped.txt @@ -595,6 +595,7 @@ GitVersion.Settings.NoCache -> bool GitVersion.Settings.NoFetch -> bool GitVersion.Settings.NoNormalize -> bool GitVersion.Settings.OnlyTrackedBranches -> bool +GitVersion.Settings.AllowShallow -> bool GitVersion.VersionCalculation.BaseVersion GitVersion.VersionCalculation.BaseVersion.BaseVersion() -> void GitVersion.VersionCalculation.BaseVersion.BaseVersion(GitVersion.VersionCalculation.BaseVersionOperand! Operand) -> void diff --git a/src/GitVersion.Core/PublicAPI.Unshipped.txt b/src/GitVersion.Core/PublicAPI.Unshipped.txt index 7dc5c58110..0bcbcd8281 100644 --- a/src/GitVersion.Core/PublicAPI.Unshipped.txt +++ b/src/GitVersion.Core/PublicAPI.Unshipped.txt @@ -1 +1,148 @@ #nullable enable +GitVersion.Configuration.EffectiveBranchConfiguration.Deconstruct(out GitVersion.Configuration.EffectiveConfiguration! Value, out GitVersion.Git.IBranch! Branch) -> void +GitVersion.Configuration.EffectiveBranchConfiguration.EffectiveBranchConfiguration(GitVersion.Configuration.EffectiveBranchConfiguration! original) -> void +GitVersion.Configuration.EffectiveConfiguration.EffectiveConfiguration(GitVersion.Configuration.EffectiveConfiguration! original) -> void +GitVersion.ConfigurationInfo.ConfigurationInfo() -> void +GitVersion.ConfigurationInfo.ConfigurationInfo(GitVersion.ConfigurationInfo! original) -> void +GitVersion.FileWriteInfo.$() -> GitVersion.FileWriteInfo! +GitVersion.FileWriteInfo.Deconstruct(out string! WorkingDirectory, out string! FileName, out string! FileExtension) -> void +GitVersion.FileWriteInfo.Equals(GitVersion.FileWriteInfo? other) -> bool +GitVersion.Git.AuthenticationInfo.AuthenticationInfo() -> void +GitVersion.Git.AuthenticationInfo.AuthenticationInfo(GitVersion.Git.AuthenticationInfo! original) -> void +GitVersion.Git.CommitFilter.CommitFilter() -> void +GitVersion.Git.CommitFilter.CommitFilter(GitVersion.Git.CommitFilter! original) -> void +GitVersion.OutputVariables.GitVersionVariables.Deconstruct(out string! Major, out string! Minor, out string! Patch, out string? BuildMetaData, out string? FullBuildMetaData, out string? BranchName, out string? EscapedBranchName, out string? Sha, out string? ShortSha, out string! MajorMinorPatch, out string! SemVer, out string! FullSemVer, out string? AssemblySemVer, out string? AssemblySemFileVer, out string? PreReleaseTag, out string? PreReleaseTagWithDash, out string? PreReleaseLabel, out string? PreReleaseLabelWithDash, out string? PreReleaseNumber, out string! WeightedPreReleaseNumber, out string? InformationalVersion, out string? CommitDate, out string? VersionSourceSha, out string? CommitsSinceVersionSource, out string? UncommittedChanges) -> void +GitVersion.OutputVariables.GitVersionVariables.GitVersionVariables(GitVersion.OutputVariables.GitVersionVariables! original) -> void +GitVersion.RepositoryInfo.RepositoryInfo() -> void +GitVersion.RepositoryInfo.RepositoryInfo(GitVersion.RepositoryInfo! original) -> void +GitVersion.SemanticVersionWithTag.$() -> GitVersion.SemanticVersionWithTag! +GitVersion.SemanticVersionWithTag.Deconstruct(out GitVersion.SemanticVersion! Value, out GitVersion.Git.ITag! Tag) -> void +GitVersion.SemanticVersionWithTag.Equals(GitVersion.SemanticVersionWithTag? other) -> bool +GitVersion.Settings.Settings() -> void +GitVersion.Settings.Settings(GitVersion.Settings! original) -> void +GitVersion.VersionCalculation.BaseVersion.$() -> GitVersion.VersionCalculation.BaseVersion! +GitVersion.VersionCalculation.BaseVersion.Deconstruct(out GitVersion.VersionCalculation.BaseVersionOperand! Operand) -> void +GitVersion.VersionCalculation.BaseVersion.Equals(GitVersion.VersionCalculation.BaseVersion? other) -> bool +GitVersion.VersionCalculation.BaseVersionOperand.$() -> GitVersion.VersionCalculation.BaseVersionOperand! +GitVersion.VersionCalculation.BaseVersionOperand.Deconstruct(out string! Source, out GitVersion.SemanticVersion! SemanticVersion, out GitVersion.Git.ICommit? BaseVersionSource) -> void +GitVersion.VersionCalculation.BaseVersionOperand.Equals(GitVersion.VersionCalculation.BaseVersionOperand? other) -> bool +GitVersion.VersionCalculation.BaseVersionOperator.$() -> GitVersion.VersionCalculation.BaseVersionOperator! +GitVersion.VersionCalculation.BaseVersionOperator.BaseVersionOperator() -> void +GitVersion.VersionCalculation.BaseVersionOperator.Equals(GitVersion.VersionCalculation.BaseVersionOperator? other) -> bool +GitVersion.VersionCalculation.Caching.GitVersionCacheKey.Deconstruct(out string! Value) -> void +GitVersion.VersionCalculation.Caching.GitVersionCacheKey.GitVersionCacheKey(GitVersion.VersionCalculation.Caching.GitVersionCacheKey! original) -> void +GitVersion.WixInfo.WixInfo() -> void +GitVersion.WixInfo.WixInfo(GitVersion.WixInfo! original) -> void +override GitVersion.Configuration.EffectiveBranchConfiguration.Equals(object? obj) -> bool +override GitVersion.Configuration.EffectiveBranchConfiguration.GetHashCode() -> int +override GitVersion.Configuration.EffectiveBranchConfiguration.ToString() -> string! +override GitVersion.Configuration.EffectiveConfiguration.Equals(object? obj) -> bool +override GitVersion.Configuration.EffectiveConfiguration.GetHashCode() -> int +override GitVersion.Configuration.EffectiveConfiguration.ToString() -> string! +override GitVersion.ConfigurationInfo.Equals(object? obj) -> bool +override GitVersion.ConfigurationInfo.GetHashCode() -> int +override GitVersion.ConfigurationInfo.ToString() -> string! +override GitVersion.FileWriteInfo.Equals(object? obj) -> bool +override GitVersion.FileWriteInfo.GetHashCode() -> int +override GitVersion.FileWriteInfo.ToString() -> string! +override GitVersion.Git.AuthenticationInfo.Equals(object? obj) -> bool +override GitVersion.Git.AuthenticationInfo.GetHashCode() -> int +override GitVersion.Git.AuthenticationInfo.ToString() -> string! +override GitVersion.Git.CommitFilter.Equals(object? obj) -> bool +override GitVersion.Git.CommitFilter.GetHashCode() -> int +override GitVersion.Git.CommitFilter.ToString() -> string! +override GitVersion.OutputVariables.GitVersionVariables.Equals(object? obj) -> bool +override GitVersion.OutputVariables.GitVersionVariables.GetHashCode() -> int +override GitVersion.OutputVariables.GitVersionVariables.ToString() -> string! +override GitVersion.RepositoryInfo.Equals(object? obj) -> bool +override GitVersion.RepositoryInfo.GetHashCode() -> int +override GitVersion.RepositoryInfo.ToString() -> string! +override GitVersion.SemanticVersionWithTag.Equals(object? obj) -> bool +override GitVersion.SemanticVersionWithTag.GetHashCode() -> int +override GitVersion.Settings.Equals(object? obj) -> bool +override GitVersion.Settings.GetHashCode() -> int +override GitVersion.Settings.ToString() -> string! +override GitVersion.VersionCalculation.BaseVersion.Equals(object? obj) -> bool +override GitVersion.VersionCalculation.BaseVersion.GetHashCode() -> int +override GitVersion.VersionCalculation.BaseVersionOperand.Equals(object? obj) -> bool +override GitVersion.VersionCalculation.BaseVersionOperand.GetHashCode() -> int +override GitVersion.VersionCalculation.BaseVersionOperator.Equals(object? obj) -> bool +override GitVersion.VersionCalculation.BaseVersionOperator.GetHashCode() -> int +override GitVersion.VersionCalculation.Caching.GitVersionCacheKey.Equals(object? obj) -> bool +override GitVersion.VersionCalculation.Caching.GitVersionCacheKey.GetHashCode() -> int +override GitVersion.VersionCalculation.Caching.GitVersionCacheKey.ToString() -> string! +override GitVersion.WixInfo.Equals(object? obj) -> bool +override GitVersion.WixInfo.GetHashCode() -> int +override GitVersion.WixInfo.ToString() -> string! +static GitVersion.Configuration.EffectiveBranchConfiguration.operator !=(GitVersion.Configuration.EffectiveBranchConfiguration? left, GitVersion.Configuration.EffectiveBranchConfiguration? right) -> bool +static GitVersion.Configuration.EffectiveBranchConfiguration.operator ==(GitVersion.Configuration.EffectiveBranchConfiguration? left, GitVersion.Configuration.EffectiveBranchConfiguration? right) -> bool +static GitVersion.Configuration.EffectiveConfiguration.operator !=(GitVersion.Configuration.EffectiveConfiguration? left, GitVersion.Configuration.EffectiveConfiguration? right) -> bool +static GitVersion.Configuration.EffectiveConfiguration.operator ==(GitVersion.Configuration.EffectiveConfiguration? left, GitVersion.Configuration.EffectiveConfiguration? right) -> bool +static GitVersion.ConfigurationInfo.operator !=(GitVersion.ConfigurationInfo? left, GitVersion.ConfigurationInfo? right) -> bool +static GitVersion.ConfigurationInfo.operator ==(GitVersion.ConfigurationInfo? left, GitVersion.ConfigurationInfo? right) -> bool +static GitVersion.FileWriteInfo.operator !=(GitVersion.FileWriteInfo? left, GitVersion.FileWriteInfo? right) -> bool +static GitVersion.FileWriteInfo.operator ==(GitVersion.FileWriteInfo? left, GitVersion.FileWriteInfo? right) -> bool +static GitVersion.Git.AuthenticationInfo.operator !=(GitVersion.Git.AuthenticationInfo? left, GitVersion.Git.AuthenticationInfo? right) -> bool +static GitVersion.Git.AuthenticationInfo.operator ==(GitVersion.Git.AuthenticationInfo? left, GitVersion.Git.AuthenticationInfo? right) -> bool +static GitVersion.Git.CommitFilter.operator !=(GitVersion.Git.CommitFilter? left, GitVersion.Git.CommitFilter? right) -> bool +static GitVersion.Git.CommitFilter.operator ==(GitVersion.Git.CommitFilter? left, GitVersion.Git.CommitFilter? right) -> bool +static GitVersion.OutputVariables.GitVersionVariables.operator !=(GitVersion.OutputVariables.GitVersionVariables? left, GitVersion.OutputVariables.GitVersionVariables? right) -> bool +static GitVersion.OutputVariables.GitVersionVariables.operator ==(GitVersion.OutputVariables.GitVersionVariables? left, GitVersion.OutputVariables.GitVersionVariables? right) -> bool +static GitVersion.RepositoryInfo.operator !=(GitVersion.RepositoryInfo? left, GitVersion.RepositoryInfo? right) -> bool +static GitVersion.RepositoryInfo.operator ==(GitVersion.RepositoryInfo? left, GitVersion.RepositoryInfo? right) -> bool +static GitVersion.SemanticVersionWithTag.operator !=(GitVersion.SemanticVersionWithTag? left, GitVersion.SemanticVersionWithTag? right) -> bool +static GitVersion.SemanticVersionWithTag.operator ==(GitVersion.SemanticVersionWithTag? left, GitVersion.SemanticVersionWithTag? right) -> bool +static GitVersion.Settings.operator !=(GitVersion.Settings? left, GitVersion.Settings? right) -> bool +static GitVersion.Settings.operator ==(GitVersion.Settings? left, GitVersion.Settings? right) -> bool +static GitVersion.VersionCalculation.BaseVersion.operator !=(GitVersion.VersionCalculation.BaseVersion? left, GitVersion.VersionCalculation.BaseVersion? right) -> bool +static GitVersion.VersionCalculation.BaseVersion.operator ==(GitVersion.VersionCalculation.BaseVersion? left, GitVersion.VersionCalculation.BaseVersion? right) -> bool +static GitVersion.VersionCalculation.BaseVersionOperand.operator !=(GitVersion.VersionCalculation.BaseVersionOperand? left, GitVersion.VersionCalculation.BaseVersionOperand? right) -> bool +static GitVersion.VersionCalculation.BaseVersionOperand.operator ==(GitVersion.VersionCalculation.BaseVersionOperand? left, GitVersion.VersionCalculation.BaseVersionOperand? right) -> bool +static GitVersion.VersionCalculation.BaseVersionOperator.operator !=(GitVersion.VersionCalculation.BaseVersionOperator? left, GitVersion.VersionCalculation.BaseVersionOperator? right) -> bool +static GitVersion.VersionCalculation.BaseVersionOperator.operator ==(GitVersion.VersionCalculation.BaseVersionOperator? left, GitVersion.VersionCalculation.BaseVersionOperator? right) -> bool +static GitVersion.VersionCalculation.Caching.GitVersionCacheKey.operator !=(GitVersion.VersionCalculation.Caching.GitVersionCacheKey? left, GitVersion.VersionCalculation.Caching.GitVersionCacheKey? right) -> bool +static GitVersion.VersionCalculation.Caching.GitVersionCacheKey.operator ==(GitVersion.VersionCalculation.Caching.GitVersionCacheKey? left, GitVersion.VersionCalculation.Caching.GitVersionCacheKey? right) -> bool +static GitVersion.WixInfo.operator !=(GitVersion.WixInfo? left, GitVersion.WixInfo? right) -> bool +static GitVersion.WixInfo.operator ==(GitVersion.WixInfo? left, GitVersion.WixInfo? right) -> bool +virtual GitVersion.Configuration.EffectiveBranchConfiguration.$() -> GitVersion.Configuration.EffectiveBranchConfiguration! +virtual GitVersion.Configuration.EffectiveBranchConfiguration.EqualityContract.get -> System.Type! +virtual GitVersion.Configuration.EffectiveBranchConfiguration.Equals(GitVersion.Configuration.EffectiveBranchConfiguration? other) -> bool +virtual GitVersion.Configuration.EffectiveBranchConfiguration.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.Configuration.EffectiveConfiguration.$() -> GitVersion.Configuration.EffectiveConfiguration! +virtual GitVersion.Configuration.EffectiveConfiguration.EqualityContract.get -> System.Type! +virtual GitVersion.Configuration.EffectiveConfiguration.Equals(GitVersion.Configuration.EffectiveConfiguration? other) -> bool +virtual GitVersion.Configuration.EffectiveConfiguration.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.ConfigurationInfo.$() -> GitVersion.ConfigurationInfo! +virtual GitVersion.ConfigurationInfo.EqualityContract.get -> System.Type! +virtual GitVersion.ConfigurationInfo.Equals(GitVersion.ConfigurationInfo? other) -> bool +virtual GitVersion.ConfigurationInfo.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.Git.AuthenticationInfo.$() -> GitVersion.Git.AuthenticationInfo! +virtual GitVersion.Git.AuthenticationInfo.EqualityContract.get -> System.Type! +virtual GitVersion.Git.AuthenticationInfo.Equals(GitVersion.Git.AuthenticationInfo? other) -> bool +virtual GitVersion.Git.AuthenticationInfo.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.Git.CommitFilter.$() -> GitVersion.Git.CommitFilter! +virtual GitVersion.Git.CommitFilter.EqualityContract.get -> System.Type! +virtual GitVersion.Git.CommitFilter.Equals(GitVersion.Git.CommitFilter? other) -> bool +virtual GitVersion.Git.CommitFilter.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.Logging.LogAction.Invoke(GitVersion.Logging.LogActionEntry! actionEntry) -> void +virtual GitVersion.Logging.LogActionEntry.Invoke(string! format, params object![]! args) -> void +virtual GitVersion.OutputVariables.GitVersionVariables.$() -> GitVersion.OutputVariables.GitVersionVariables! +virtual GitVersion.OutputVariables.GitVersionVariables.EqualityContract.get -> System.Type! +virtual GitVersion.OutputVariables.GitVersionVariables.Equals(GitVersion.OutputVariables.GitVersionVariables? other) -> bool +virtual GitVersion.OutputVariables.GitVersionVariables.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.RepositoryInfo.$() -> GitVersion.RepositoryInfo! +virtual GitVersion.RepositoryInfo.EqualityContract.get -> System.Type! +virtual GitVersion.RepositoryInfo.Equals(GitVersion.RepositoryInfo? other) -> bool +virtual GitVersion.RepositoryInfo.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.Settings.$() -> GitVersion.Settings! +virtual GitVersion.Settings.EqualityContract.get -> System.Type! +virtual GitVersion.Settings.Equals(GitVersion.Settings? other) -> bool +virtual GitVersion.Settings.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.VersionCalculation.Caching.GitVersionCacheKey.$() -> GitVersion.VersionCalculation.Caching.GitVersionCacheKey! +virtual GitVersion.VersionCalculation.Caching.GitVersionCacheKey.EqualityContract.get -> System.Type! +virtual GitVersion.VersionCalculation.Caching.GitVersionCacheKey.Equals(GitVersion.VersionCalculation.Caching.GitVersionCacheKey? other) -> bool +virtual GitVersion.VersionCalculation.Caching.GitVersionCacheKey.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.WixInfo.$() -> GitVersion.WixInfo! +virtual GitVersion.WixInfo.EqualityContract.get -> System.Type! +virtual GitVersion.WixInfo.Equals(GitVersion.WixInfo? other) -> bool +virtual GitVersion.WixInfo.PrintMembers(System.Text.StringBuilder! builder) -> bool diff --git a/src/GitVersion.MsBuild.Tests/Tasks/TestTaskBase.cs b/src/GitVersion.MsBuild.Tests/Tasks/TestTaskBase.cs index e2f1bbcdd5..c0c7999983 100644 --- a/src/GitVersion.MsBuild.Tests/Tasks/TestTaskBase.cs +++ b/src/GitVersion.MsBuild.Tests/Tasks/TestTaskBase.cs @@ -10,7 +10,7 @@ namespace GitVersion.MsBuild.Tests.Tasks; -public class TestTaskBase : TestBase +public abstract class TestTaskBase : TestBase { protected IFileSystem FileSystem; diff --git a/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props b/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props index e1f335e940..c497718e77 100644 --- a/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props +++ b/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props @@ -11,20 +11,22 @@ false false false + false $(GitVersion_CommandLineArguments) -output file -outputfile "$(GitVersionOutputFile)" $(GitVersion_ToolArgments) -nofetch $(GitVersion_ToolArgments) -nonormalize $(GitVersion_ToolArgments) -nocache + $(GitVersion_ToolArgments) -allowshallow - true - + false diff --git a/src/GitVersion.Schema/GitVersion.Schema.csproj b/src/GitVersion.Schema/GitVersion.Schema.csproj index 3b8e57273a..beef892b98 100644 --- a/src/GitVersion.Schema/GitVersion.Schema.csproj +++ b/src/GitVersion.Schema/GitVersion.Schema.csproj @@ -4,7 +4,6 @@ schema -