Skip to content

Commit 54adbb2

Browse files
committed
docs: explain v7 defaults and staged compatibility removal
1 parent 81634ff commit 54adbb2

5 files changed

Lines changed: 62 additions & 21 deletions

File tree

BREAKING_CHANGES.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ GitVersion is migrating away from LibGit2Sharp and its native libgit2 binaries t
3535

3636
| Release | Default backend | Switch |
3737
| ------- | --------------- | ------ |
38-
| v7.0 | `libgit2` | `GITVERSION_GIT_BACKEND=managed` to opt in to the new backend |
39-
| v7.1 | `managed` | `GITVERSION_GIT_BACKEND=libgit2` to fall back |
40-
| later | `managed` | libgit2 backend removed |
38+
| v7.0 | `managed` | `GITVERSION_GIT_BACKEND=libgit2` is a temporary fallback |
39+
| v7.1 | `managed` | libgit2 is removed; `libgit2` reports an actionable error, explicit `managed` remains accepted |
40+
| v8 | `managed` | the selector is removed |
4141

4242
Behavioral notes when using the `managed` backend:
4343

4444
* Mutating and network operations (repository normalization on CI build agents, dynamic repositories via `--url`, checkout, fetch) are performed by invoking the `git` executable, which must be available on the `PATH`. Plain version calculation on an already-prepared checkout does not require it.
45-
* v7.0 behavior is unchanged unless you opt in. Please test the `managed` backend and report issues — the libgit2 backend will be removed once the new backend has proven itself over several releases.
45+
* The default changes to `managed` in v7.0. LibGit2Sharp/native binaries remain available through the explicit fallback until their scheduled v7.1 removal.
4646

4747
### Invalid label formatting is not ignored
4848
Previously bad label formatting config would be silently accepted. For example `{Branhc}` (when BranchName is misspelled) or even `{BranchName` (missing a closing brace). This is not ignored now and exceptions will be thrown if formatting problems exist in the label config. This brings it into line with how assembly string formatting is treated.
@@ -53,7 +53,13 @@ The command-line interface has been migrated from Windows-style (`/switch` and s
5353

5454
**Old-style arguments are no longer accepted by default.** Update any scripts, CI pipelines, or tooling accordingly.
5555

56-
As a temporary migration aid, set the environment variable `GITVERSION_USE_V6_ARGUMENT_PARSER=true` to restore the legacy `/switch` and `-switch` argument handling. This escape hatch will be removed in a future release.
56+
As a temporary v7.0 migration aid, set `GITVERSION_ARGUMENT_PARSER_VERSION=v6` to restore legacy `/switch` and `-switch` handling. The default is `v7`. Unset `GITVERSION_USE_V6_ARGUMENT_PARSER`: any presence of that retired variable, including `false`, now fails with replacement guidance. The legacy parser is scheduled for removal in v7.1; the selector remains until v8.
57+
58+
The parser, configuration and Git backend selectors are independent. They trim
59+
values, ignore case, treat blanks as unset and reject unknown values with the
60+
accepted values. Effective selections are logged at information level; console
61+
logs use stderr for machine-readable output, while build-server logs keep their
62+
existing channel.
5763

5864
### Configuration structure and migration
5965

@@ -75,6 +81,10 @@ writes YAML to stdout by default, supports `--config`, `--output`,
7581
`--in-place`, and `--force`, and warns that comments cannot be preserved when
7682
replacing a file.
7783

84+
Flat v6 runtime support is scheduled for removal in v7.1. Explicit `v7` remains
85+
accepted throughout v7.x, and the configuration selector is removed in v8.
86+
`gitversion config migrate` remains available after runtime removal.
87+
7888
#### Full argument mapping
7989

8090
| Old argument | New argument | Short alias | Env var alternative |

docs/design/managed-git-migration.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ Build `GitVersion.Git.Managed` bottom-up with per-layer unit tests against git-C
200200
(loose/packed/mixed objects, packed-refs, worktrees, shallow, multi-pack-index, index v4).
201201
The final B step takes the `GitVersion.Core` reference, lands the direct `IGitRepository`/
202202
`IMutatingGitRepository` implementations, absorbs `GitVersion.Git.CommandLine` (see §4), and wires
203-
backend selection via `GITVERSION_GIT_BACKEND=managed|libgit2` (default `libgit2`). Validation:
203+
backend selection via `GITVERSION_GIT_BACKEND=managed|libgit2` (initially `libgit2`, changed to `managed` for v7.0 under #5135). Validation:
204204
- **CI matrix**: full integration suites (`GitVersion.Core.Tests`, `GitVersion.App.Tests`) run on both backends,
205205
three OSes — the suites assert exact SemVer strings over complex histories and are the strongest parity oracle
206206
- **DualBackendParityTests**: open the same fixture with both backends; deep-equality on ref enumeration,
@@ -209,25 +209,33 @@ backend selection via `GITVERSION_GIT_BACKEND=managed|libgit2` (default `libgit2
209209
- **Real-world corpus script**: `gitversion /nocache /output json` diffed across backends on this repo,
210210
GitReleaseManager, dotnet/runtime, a shallow CI-style clone, and a worktree checkout
211211

212-
### Phase C — default flip in v7.1 · ~1 week + multi-release soak
213-
**v7.0 ships with default `libgit2`** (managed opt-in); **v7.1 flips the default to `managed`** with
214-
`GITVERSION_GIT_BACKEND=libgit2` as the fallback while users validate the new backend. The dual-backend
215-
CI matrix stays green throughout the window.
212+
### Phase C — managed default in v7.0
213+
**v7.0 ships with default `managed`** under #5135, with
214+
`GITVERSION_GIT_BACKEND=libgit2` as the temporary fallback. The independent
215+
parser/configuration selectors default to `v7`. All selectors trim values,
216+
ignore case, treat blanks as unset and reject unknown values. Effective
217+
selections are logged without mixing logs into machine-readable stdout.
218+
The dual-backend CI matrix stays green throughout the v7.0 window.
216219

217220
### Phase D — fixture migration (parallel with B) · ~2–3 weeks
218221
`GitVersion.Testing` moves to pure git-CLI writes via the existing `ExecuteGitCmd` pattern:
219222
deterministic `GIT_AUTHOR_*`/`GIT_COMMITTER_*` env (several tests advance commit time explicitly),
220223
`git commit --allow-empty`, `-c commit.gpgsign=false -c gc.auto=0`. Migrate the six direct-usage test files.
221224
If suite time regresses from process spawns, batch history creation with `git fast-import`.
222225

223-
### Phase E — remove LibGit2Sharp · ~1–2 weeks
226+
### Phase E — remove LibGit2Sharp in v7.1 (#5040)
224227
Delete `src/GitVersion.LibGit2Sharp` and `new-cli/GitVersion.Core.Libgit2Sharp`; drop the package from
225228
`Directory.Packages.props`; re-point new-cli source-linking at `GitVersion.Git.Managed`
226229
(read-only subset). Add a packaging assertion test: **zero `runtimes/**/native/*` entries** in the
227230
`GitVersion.MsBuild` and `GitVersion.Tool` nupkgs. Document the new runtime requirement: `git` on PATH is needed
228231
**only** for dynamic-repo/CI-normalization scenarios — pure version calculation on a prepared checkout needs no
229232
git binary at all (a strict improvement for MSBuild-task users).
230233

234+
Parser and flat configuration runtime removal in v7.1 is tracked separately
235+
by #5188. Keep `gitversion config migrate` and actionable retired selector
236+
value diagnostics throughout v7.x. #5136 removes all three selectors in v8;
237+
explicit `v7` and `managed` remain accepted until then.
238+
231239
### Phase F (optional) — performance accelerators · ~2–3 weeks
232240
Commit-graph reader (generation numbers for topo sort and merge-base), benchmark-driven pack cache tuning.
233241

docs/input/docs/migration/v6-to-v7.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ GitVersion now uses POSIX-style command-line arguments powered by System.Command
5151
:::{.alert .alert-warning}
5252
**Breaking change:** Legacy Windows-style (`/switch`) and legacy single-dash long-form (`-switch`) arguments are no longer accepted by default.
5353

54-
As a temporary migration aid, set `GITVERSION_USE_V6_ARGUMENT_PARSER=true` to restore legacy argument handling. This compatibility mode is temporary and will be removed in a future release.
54+
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.
5555
:::
5656

5757
### What you need to change
@@ -149,14 +149,14 @@ migrate` to retain schema validation.
149149

150150
## Git backend
151151

152-
GitVersion v7 introduces a fully managed Git backend as an alternative to the native LibGit2Sharp (libgit2) implementation. The backend is selected with the `GITVERSION_GIT_BACKEND` environment variable. When the variable is not set (or empty), the release's default backend is used — you never need to set it. Setting it to any value other than `libgit2` or `managed` (case-insensitive) is an error: GitVersion fails fast instead of silently running the default backend with a typo unnoticed.
152+
GitVersion v7.0 uses the managed Git backend by default. The `GITVERSION_GIT_BACKEND` environment variable accepts `managed` or the temporary `libgit2` fallback.
153153

154154
:::{.alert .alert-info}
155-
In v7.0 the `libgit2` backend remains the **default** — behaviour is unchanged unless you opt in. Set `GITVERSION_GIT_BACKEND=managed` to try the managed backend and help validate it. In v7.1 the default flips to `managed`, with `GITVERSION_GIT_BACKEND=libgit2` available as a fallback. Both backends ship side by side for several releases before libgit2 is removed.
155+
In v7.0, use `GITVERSION_GIT_BACKEND=libgit2` only if you need the temporary native backend fallback. LibGit2Sharp and its native binaries are scheduled for removal in v7.1. Explicit `managed` remains accepted throughout v7.x; the selector is removed in v8.
156156
:::
157157

158-
- `libgit2` — the native, libgit2-based backend (default in v7.0).
159-
- `managed` — a managed implementation for all read/history operations, combined with the `git` command-line executable for network and write operations (clone, fetch, checkout, and CI repository normalization).
158+
- `libgit2` — the temporary native backend fallback in v7.0.
159+
- `managed`the v7.0 default: a managed implementation for all read/history operations, combined with the `git` command-line executable for network and write operations (clone, fetch, checkout, and CI repository normalization).
160160

161161
:::{.alert .alert-warning}
162162
When using the `managed` backend, the `git` executable must be available on the `PATH` **only** for the network/normalization scenarios above (dynamic repositories, build-agent normalization). Plain version calculation on an already-prepared checkout does not require `git` on the `PATH`.
@@ -169,7 +169,26 @@ The environment variables relevant to migrating from v6 to v7:
169169
| Variable | Purpose |
170170
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
171171
| `GITVERSION_CONFIGURATION_VERSION` | Selects the configuration layout: `v7` (default) or temporary flat `v6` fallback. |
172-
| `GITVERSION_GIT_BACKEND` | Selects the Git backend: `libgit2` (default in v7.0) or `managed`. See [Git backend](#git-backend). |
173-
| `GITVERSION_USE_V6_ARGUMENT_PARSER` | Set to `true` to temporarily restore the legacy v6 (`/switch`) argument parser. Removed in a future release. |
172+
| `GITVERSION_GIT_BACKEND` | Selects the Git backend: `managed` (default) or temporary `libgit2` fallback. See [Git backend](#git-backend). |
173+
| `GITVERSION_ARGUMENT_PARSER_VERSION` | Selects the argument parser: `v7` (default, POSIX syntax) or temporary `v6` fallback (`/switch` and `-switch`). |
174174
| `GITVERSION_REMOTE_USERNAME` | Alternative to `--username` for dynamic-repository credentials. |
175175
| `GITVERSION_REMOTE_PASSWORD` | Alternative to `--password` for dynamic-repository credentials. |
176+
177+
The three selectors are independent: selecting the v6 parser does not select
178+
flat configuration or libgit2. Values are trimmed and case-insensitive;
179+
unset, empty, and whitespace-only values use the defaults. Unknown values
180+
fail before execution and list the accepted values. Replace
181+
`GITVERSION_USE_V6_ARGUMENT_PARSER=true` with
182+
`GITVERSION_ARGUMENT_PARSER_VERSION=v6` and unset the old variable.
183+
184+
Effective selections are logged at information level. Use `--log-file <path>`
185+
to capture them or `--log-file console` to see them on stderr with
186+
machine-readable output. Build-server console logging retains its normal
187+
output channel. For migration, place logging options before the command:
188+
`gitversion --log-file console config migrate --config GitVersion.yml`.
189+
190+
In v7.1, legacy parser and flat configuration runtime support are scheduled
191+
for removal alongside libgit2. Retired `v6`/`libgit2` selections will report
192+
actionable errors; explicit `v7`/`managed` selections remain accepted during
193+
v7.x. All three selectors are removed in v8. `gitversion config migrate`
194+
remains available to convert flat files after runtime support is removed.

docs/input/docs/reference/environment-variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Distinguish variables **read by GitVersion** from version variables **exported t
88

99
`Git_Branch` can identify the branch or tag when the build context is ambiguous. Provider-specific detection is described in the [CI guides](/docs/reference/build-servers). Ensure the selected reference and its history are available in the checkout.
1010

11-
The [v6 to v7 migration guide](/docs/migration/v6-to-v7#environment-variables) documents Git backend selection and temporary compatibility controls, including `GITVERSION_USE_V6_ARGUMENT_PARSER`. Compatibility switches are migration aids, not recommended defaults for a new setup.
11+
The [v6 to v7 migration guide](/docs/migration/v6-to-v7#environment-variables) 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.
1212

1313
## Output variables
1414

docs/input/docs/usage/cli/arguments.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ Description: The supported arguments of the GitVersion Command Line Interface
88
**Note:** GitVersion uses POSIX-style `--long-name` arguments from version 7 and up. Long-form
99
arguments are recommended for readability in scripts and documentation. Short aliases
1010
(e.g. `-l`, `-o`, `-b`) are also supported. The legacy `/switch` and `-switch`
11-
syntax is still available when `GITVERSION_USE_V6_ARGUMENT_PARSER=true` is set.
11+
syntax is available during v7.0 when `GITVERSION_ARGUMENT_PARSER_VERSION=v6` is set.
12+
The default is `v7`. Unset the retired `GITVERSION_USE_V6_ARGUMENT_PARSER`
13+
variable; it now produces a replacement diagnostic. The legacy parser is
14+
removed in v7.1 and the selector in v8.
1215

1316
See [Migration v6 to v7](/docs/migration/v6-to-v7) for upgrade guidance and the full argument mapping.
1417
:::
@@ -122,7 +125,8 @@ writes YAML to stdout unless `--output` or `--in-place` is selected. `--output`
122125
will not replace an existing file without `--force`; it cannot be combined with
123126
`--in-place`. Replacing a file warns that comments are not preserved. The
124127
command does not require a Git repository and is unavailable when
125-
`GITVERSION_USE_V6_ARGUMENT_PARSER=true` selects the legacy parser.
128+
`GITVERSION_ARGUMENT_PARSER_VERSION=v6` selects the legacy parser. Migration
129+
remains available after v6 runtime support is removed in v7.1.
126130
127131
## Override config
128132

0 commit comments

Comments
 (0)