Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
## Unreleased

### GitVersion 7.1 removes the v6 parser and configuration runtime

Only POSIX CLI arguments and nested `calculation` / `output` configuration are
supported. `GITVERSION_ARGUMENT_PARSER_VERSION=v6` and
`GITVERSION_CONFIGURATION_VERSION=v6` now fail with migration guidance. Unset
these variables or set them to `v7`, which remains an accepted no-op throughout
v7.x. The retired `GITVERSION_USE_V6_ARGUMENT_PARSER` variable must remain unset.

`gitversion config migrate` still converts flat v6 configuration, including
outside a Git repository. Migrate the file before using it for calculation or
validation. Diagnostic logs remain on stderr; machine-readable stdout is unchanged.
The Git backend selector and LibGit2Sharp removal are tracked separately in #5040;
selector-variable removal belongs to v8 (#5136).

### Docker images run as non-root

Docker images now default to UID/GID `10001:10001`. On Linux, bind-mounted
Expand Down Expand Up @@ -123,7 +137,7 @@ writes YAML to stdout by default, supports `--config`, `--output`,
`--in-place`, and `--force`, and warns that comments cannot be preserved when
replacing a file.

Flat v6 runtime support is scheduled for removal in v7.1. Explicit `v7` remains
Flat v6 runtime support is removed in v7.1. Explicit `v7` remains
accepted throughout v7.x, and the configuration selector is removed in v8.
`gitversion config migrate` remains available after runtime removal.

Expand Down
10 changes: 9 additions & 1 deletion docs/design/managed-git-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ Delete `src/GitVersion.LibGit2Sharp` and `new-cli/GitVersion.Core.Libgit2Sharp`;
**only** for dynamic-repo/CI-normalization scenarios — pure version calculation on a prepared checkout needs no
git binary at all (a strict improvement for MSBuild-task users).

Parser and flat configuration runtime removal in v7.1 is tracked separately
Parser and flat configuration runtime removal in v7.1 is implemented separately
by #5188. Keep `gitversion config migrate` and actionable retired selector
value diagnostics throughout v7.x. #5136 removes all three selectors in v8;
explicit `v7` and `managed` remain accepted until then.
Expand Down Expand Up @@ -303,3 +303,11 @@ Commit-graph reader (generation numbers for topo sort and merge-base), benchmark
[gitreader]: https://github.com/kekyo/GitReader

[managedgitlib]: https://github.com/GlebChili/ManagedGitLib

### v7.1 parser/configuration compatibility boundary

The CLI registers only the POSIX parser and nested v7 configuration runtime.
Parser/configuration selectors retain their v7.x compatibility validators: explicit
`v7` is a no-op and `v6` fails with migration guidance. `config migrate` continues
to read flat v6 input independently of runtime loading. Git backend selection is
unchanged by #5188 and remains governed by #5040; v8 selector removal is #5136.
29 changes: 16 additions & 13 deletions docs/input/docs/migration/v6-to-v7.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ matching-version schema and loader checks.
resolution, without waiting for calculation. With `Strict`, use a complete version
such as `2.0.0`. Select `Loose` explicitly when using partial values such as `2.1`.

Explicit `GITVERSION_CONFIGURATION_VERSION=v6` retains its existing v7.0 warning
and v7.1 removal schedule. It selects the flat layout independently of the parser;
invalid v7 documents never trigger automatic v6 fallback. See
In v7.0, explicit `GITVERSION_CONFIGURATION_VERSION=v6` selected the flat layout
with a compatibility warning. Starting in v7.1 this selector value is rejected:
unset it or set it to `v7`, then run `gitversion config migrate` on the old file.
Invalid v7 documents never trigger automatic v6 fallback. See
[configuration validation][configuration-validation] for output and error contracts.

## Docker images run as non-root
Expand Down Expand Up @@ -177,7 +178,7 @@ GitVersion now uses POSIX-style command-line arguments powered by System.Command
:::{.alert .alert-warning}
**Breaking change:** Legacy Windows-style (`/switch`) and legacy single-dash long-form (`-switch`) arguments are no longer accepted by default.

As a temporary v7.0 migration aid, set `GITVERSION_ARGUMENT_PARSER_VERSION=v6` to restore legacy argument handling. The legacy parser is removed in v7.1. Unset the retired `GITVERSION_USE_V6_ARGUMENT_PARSER` variable: its presence is an error, even when set to `false`; it is not an alias for the new selector.
GitVersion v7.0 offered `GITVERSION_ARGUMENT_PARSER_VERSION=v6` as a temporary migration aid. In v7.1 that value is an error: use POSIX arguments and unset the selector or set it to `v7`. Unset the retired `GITVERSION_USE_V6_ARGUMENT_PARSER` variable: its presence is an error, even when set to `false`; it is not an alias for the new selector.
:::

### What you need to change
Expand Down Expand Up @@ -262,7 +263,9 @@ with `--in-place`. In-place migration warns because comments cannot be
preserved. The command does not need a Git repository and migrating its v7
output again is idempotent. In v7.0, you can temporarily validate a flat file
with `GITVERSION_CONFIGURATION_VERSION=v6`; GitVersion warns once for that
fallback.
fallback. Starting in v7.1, both parser and configuration selectors reject `v6`;
unset them or set them to `v7` before running the retained migration command.
Flat-file runtime loading and serialization are no longer available.

GitVersion 7 publishes a nested-only schema at
`https://gitversion.net/schemas/7.0/GitVersion.configuration.json`. If you
Expand Down Expand Up @@ -294,18 +297,18 @@ The environment variables relevant to migrating from v6 to v7:

| Variable | Purpose |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `GITVERSION_CONFIGURATION_VERSION` | Selects the configuration layout: `v7` (default) or temporary flat `v6` fallback. |
| `GITVERSION_CONFIGURATION_VERSION` | In v7.1, accepts `v7` as a no-op; `v6` is rejected with configuration migration guidance. |
| `GITVERSION_GIT_BACKEND` | Selects the Git backend: `managed` (default) or temporary `libgit2` fallback. See [Git backend][git-backend]. |
| `GITVERSION_ARGUMENT_PARSER_VERSION` | Selects the argument parser: `v7` (default, POSIX syntax) or temporary `v6` fallback (`/switch` and `-switch`). |
| `GITVERSION_ARGUMENT_PARSER_VERSION` | In v7.1, accepts `v7` as a no-op; `v6` is rejected with POSIX migration guidance. |
| `GITVERSION_REMOTE_USERNAME` | Alternative to `--username` for dynamic-repository credentials. |
| `GITVERSION_REMOTE_PASSWORD` | Alternative to `--password` for dynamic-repository credentials. |

The three selectors are independent: selecting the v6 parser does not select
flat configuration or libgit2. Values are trimmed and case-insensitive;
The selectors remain independent compatibility validators: `v7` parser and
configuration values do not change the selected Git backend. Values are trimmed and case-insensitive;
unset, empty, and whitespace-only values use the defaults. Unknown values
fail before execution and list the accepted values. Replace
`GITVERSION_USE_V6_ARGUMENT_PARSER=true` with
`GITVERSION_ARGUMENT_PARSER_VERSION=v6` and unset the old variable.
`GITVERSION_ARGUMENT_PARSER_VERSION=v7` (or unset the selector) and use POSIX syntax.

Effective selections are logged at information level. Use `--log-file <path>`
to capture them or `--log-file console` to see them on stderr. Console logs
Expand All @@ -314,9 +317,9 @@ with JSON or other machine-readable output. Build-server integration commands
retain their normal output channel. For migration, place logging options before the command:
`gitversion --log-file console config migrate --config GitVersion.yml`.

In v7.1, legacy parser and flat configuration runtime support are scheduled
for removal alongside libgit2. Retired `v6`/`libgit2` selections will report
actionable errors; explicit `v7`/`managed` selections remain accepted during
In v7.1, legacy parser and flat configuration runtime support are removed.
Retired `v6` selections report actionable errors; LibGit2Sharp removal is
tracked independently in #5040. Explicit `v7`/`managed` selections remain accepted during
v7.x. All three selectors are removed in v8. `gitversion config migrate`
remains available to convert flat files after runtime support is removed.

Expand Down
2 changes: 1 addition & 1 deletion docs/input/docs/reference/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ GitVersion reads the configuration file from the working/project directory as
usual; an environment branch override does not check out another configuration file.
Provider-specific detection is described in the [CI guides][ci-guides].

The [v6 to v7 migration guide][v6-to-v7-migration-guide] documents the independent selectors `GITVERSION_ARGUMENT_PARSER_VERSION`, `GITVERSION_CONFIGURATION_VERSION`, and `GITVERSION_GIT_BACKEND`. Their v7.0 defaults are `v7`, `v7`, and `managed`; temporary fallbacks are `v6`, `v6`, and `libgit2`. Values are trimmed and case-insensitive; blank values use the defaults and unknown values fail with accepted-value guidance. The retired `GITVERSION_USE_V6_ARGUMENT_PARSER` variable must be unset. Legacy implementations are removed in v7.1 and selectors in v8.
The [v6 to v7 migration guide][v6-to-v7-migration-guide] documents the independent selectors `GITVERSION_ARGUMENT_PARSER_VERSION`, `GITVERSION_CONFIGURATION_VERSION`, and `GITVERSION_GIT_BACKEND`. Their v7.0 defaults are `v7`, `v7`, and `managed`. In v7.1, parser/configuration `v6` values are rejected with removal guidance; unset those variables or use `v7` as a compatibility no-op. Flat v6 files can still be converted with `gitversion config migrate`. Git backend removal is tracked separately in #5040. Values are trimmed and case-insensitive; blank values use the defaults and unknown values fail with accepted-value guidance. The retired `GITVERSION_USE_V6_ARGUMENT_PARSER` variable must be unset. Parser/configuration runtime fallbacks were removed in v7.1; selector variables remain until v8.

## Output variables

Expand Down
39 changes: 16 additions & 23 deletions docs/input/docs/usage/cli/arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Description: The supported arguments of the GitVersion Command Line Interface
**Note:** GitVersion uses POSIX-style `--long-name` arguments from version 7 and up. Long-form
arguments are recommended for readability in scripts and documentation. Short aliases
(e.g. `-l`, `-o`, `-b`) are also supported. The legacy `/switch` and `-switch`
syntax is available during v7.0 when `GITVERSION_ARGUMENT_PARSER_VERSION=v6` is set.
syntax was available only as a temporary v7.0 fallback. Starting in v7.1,
`GITVERSION_ARGUMENT_PARSER_VERSION=v6` fails with POSIX migration guidance.
The default is `v7`. Unset the retired `GITVERSION_USE_V6_ARGUMENT_PARSER`
variable; it now produces a replacement diagnostic. The legacy parser is
removed in v7.1 and the selector in v8.
Expand Down Expand Up @@ -192,15 +193,14 @@ Codes are stable within schema version 1; human messages may change:
| `GVCONFIG_REGEX` | Invalid regular expression |
| `GVCONFIG_BRANCH` | Missing branch regex or unresolved branch reference |
| `GVCONFIG_VALUE` | Invalid semantic value or invocation path |
| `GVCONFIG_V6_COMPATIBILITY` | Non-failing temporary v6 compatibility warning |

Parser failures before command execution (unknown options, missing option arguments,
extra positional arguments) retain ordinary stderr/exit 1 behavior without JSON.
Feature-selector errors also occur before command execution.

Configuration layout selection remains separate from parser selection. Explicit
`GITVERSION_CONFIGURATION_VERSION=v6` accepts flat files during v7.0 and emits the
existing warning; legacy loading is removed in v7.1. Invalid v7 documents never
Configuration layout selection remains separate from parser selection. Starting in v7.1,
`GITVERSION_CONFIGURATION_VERSION=v6` is rejected before command execution.
Unset the variable or set it to `v7`; flat files must be migrated before validation. Invalid v7 documents never
fall back to v6. Use `config migrate` to convert a legacy file. This command is
unavailable with the legacy parser and published v6 tools.

Expand Down Expand Up @@ -266,12 +266,10 @@ Supported options are `--config`/`-c`, repeated `--override-config key=value`,
must precede `config get`. Version-output, calculation and file-update options
cannot be combined with this command. Use `gitversion config get --help` for help.

The command requires the default modern argument parser and default or explicit
`GITVERSION_CONFIGURATION_VERSION=v7`. Selecting v6 configuration produces a
v7-required error before configuration loading, even when the modern parser is
selected; GitVersion does not switch versions implicitly. Existing v6 full
configuration display retains its behavior. With v7 configuration,
`--show-config` now includes runtime overrides, matching the query result.
The command uses the v7 parser and configuration runtime. In v7.1, selecting
`GITVERSION_CONFIGURATION_VERSION=v6` fails with migration guidance before
configuration loading. `--show-config` includes runtime overrides, matching
the query result.

## CLI schema

Expand All @@ -293,9 +291,9 @@ It discovers a supported configuration filename when `--config` is omitted and
writes YAML to stdout unless `--output` or `--in-place` is selected. `--output`
will not replace an existing file without `--force`; it cannot be combined with
`--in-place`. Replacing a file warns that comments are not preserved. The
command does not require a Git repository and is unavailable when
`GITVERSION_ARGUMENT_PARSER_VERSION=v6` selects the legacy parser. Migration
remains available after v6 runtime support is removed in v7.1.
command does not require a Git repository. Starting in v7.1, unset the parser
and configuration selectors or set them to `v7` before migration; `v6` selector
values are retired, while flat v6 input remains supported by this command.

## Override config

Expand All @@ -305,12 +303,8 @@ With the v7 default configuration layout, use a version-aware nested key. For
example, `calculation.tag-prefix=custom`,
`calculation.branches.main.increment=Patch`, and
`output.branches.main.pre-release-weight=55000`. Flat v6 keys are rejected in
v7 mode with their nested replacement. Set
`GITVERSION_CONFIGURATION_VERSION=v6` only while validating a legacy file in
v7.0.

When that temporary v6 fallback is selected, use the legacy branch override
path, for example `--override-config branches.main.increment=Patch`.
v7 mode with their nested replacement. Starting in v7.1, no flat runtime
override path is supported; migrate old files with `gitversion config migrate`.

To specify multiple options add multiple `--override-config key=value` entries:
`--override-config key1=value1 --override-config key2=value2`.
Expand All @@ -319,9 +313,8 @@ To have **space characters** as a part of `value`, `value` has to be enclosed wi

Double quote character inside of the double quoted `value` has to be escaped with a backslash '\\' - `key="My \"escaped-quotes\""`.

The following override paths are supported in v7. For the temporary v6
fallback, omit the `calculation.` or `output.` prefix. The shared `workflow`
key stays at the root in both versions:
The following override paths are supported in v7. The shared `workflow`
key stays at the root:

1. `output.assembly-file-versioning-format`
2. `output.assembly-file-versioning-scheme`
Expand Down
Loading
Loading