Skip to content

Allow GIT_CONFIG_GLOBAL to be set to NUL (all upper-case) - #6450

Merged
dscho merged 1 commit into
git-for-windows:mainfrom
dscho:allow-setting-GIT_CONFIG_GLOBAL-to-NUL
Oct 1, 2026
Merged

dscho merged 1 commit into
git-for-windows:mainfrom
dscho:allow-setting-GIT_CONFIG_GLOBAL-to-NUL

Conversation

@dscho

@dscho dscho commented Sep 29, 2026

Copy link
Copy Markdown
Member

Currently, when running GIT_CONFIG_GLOBAL=NUL git config --list, it fails with:

fatal: unable to access 'NUL': Invalid argument

The underlying reason is the different behavior of the C runtime used by MINGW64 vs UCRT64. Let's accommodate for that.

This fixes #6449

The special-casing of `NUL` in `mingw_access()` was added in
9160068 (msvc: avoid calling `access("NUL", flags)`, 2021-04-16)
because the Universal C Runtime's ("UCRT") `_waccess()` rejects `NUL` as
an invalid argument.

With the switch of GIt for Windows from the MSVCRT-based MINGW64 build
to the UCRT-based UCRT64 build in 2.56.0, any spelling other than
lowercase `nul` now reaches `_waccess()` and fails. Windows device names
are case-insensitive, and `NUL` is the canonical spelling, but even
`Nul` is allowed, so a case-insensitive comparison is needed.

Note that we cannot use `fspathcmp()` here, as we would usually do: This
function is in the code path when reading the config, and
`core.ignoreCase` would therefore not be set correctly yet e.g. when
running under `GIT_CONFIG_GLOBAL=NUL`.

This fixes git-for-windows#6449

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho added this to the Next release milestone Sep 29, 2026
@dscho
dscho requested review from mjcheetham and rimrul September 29, 2026 13:59
@dscho dscho self-assigned this Sep 29, 2026
@dscho

dscho commented Sep 29, 2026 •

Copy link
Copy Markdown
Member Author

/snapshot

The tag-git workflow run was started for merge commit 7ffa7cd

@gitforwindowshelper

Copy link
Copy Markdown

Validate the installer manually

The installer was built successfully;
Please download, install, and run through the pre-flight check-list.
@dscho ☝️

@dscho

dscho commented Sep 30, 2026 •

Copy link
Copy Markdown
Member Author

/add relnote bug Suppressing the user-wide Git config via GIT_CONFIG_GLOBAL=NUL was broken in v2.56.0 (surprisingly, as a consequence of the MINGW64 -> UCRT64 migration), which was fixed.

The workflow run was started

github-actions Bot pushed a commit to git-for-windows/build-extra that referenced this pull request Sep 30, 2026
Suppressing the user-wide Git config via `GIT_CONFIG_GLOBAL=NUL` [was
broken in v2.56.0](git-for-windows/git#6449)
(surprisingly, as a consequence of the MINGW64 -> UCRT64 migration),
which [was fixed](git-for-windows/git#6450).

Signed-off-by: gitforwindowshelper[bot] <gitforwindowshelper-bot@users.noreply.github.com>
@dscho

dscho commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

Before merging, I need to fix the failing git-artifacts-i686 build, and deploy mingw-w64-openssl (which is currently re-running a previously failed arm64 deployment).

@dscho
dscho merged commit 2734d89 into git-for-windows:main Oct 1, 2026
116 of 117 checks passed
@dscho
dscho deleted the allow-setting-GIT_CONFIG_GLOBAL-to-NUL branch October 1, 2026 17:21
gitforwindowshelper Bot pushed a commit that referenced this pull request Oct 1, 2026
Currently, when running `GIT_CONFIG_GLOBAL=NUL git config --list`, it
fails with:

```
fatal: unable to access 'NUL': Invalid argument
```

The underlying reason is the different behavior of the C runtime used by
MINGW64 vs UCRT64. Let's accommodate for that.

This fixes #6449
gitforwindowshelper Bot pushed a commit that referenced this pull request Oct 1, 2026
Currently, when running `GIT_CONFIG_GLOBAL=NUL git config --list`, it
fails with:

```
fatal: unable to access 'NUL': Invalid argument
```

The underlying reason is the different behavior of the C runtime used by
MINGW64 vs UCRT64. Let's accommodate for that.

This fixes #6449
gitforwindowshelper Bot pushed a commit that referenced this pull request Oct 1, 2026
Currently, when running `GIT_CONFIG_GLOBAL=NUL git config --list`, it
fails with:

```
fatal: unable to access 'NUL': Invalid argument
```

The underlying reason is the different behavior of the C runtime used by
MINGW64 vs UCRT64. Let's accommodate for that.

This fixes #6449
gitforwindowshelper Bot pushed a commit that referenced this pull request Oct 2, 2026
Currently, when running `GIT_CONFIG_GLOBAL=NUL git config --list`, it
fails with:

```
fatal: unable to access 'NUL': Invalid argument
```

The underlying reason is the different behavior of the C runtime used by
MINGW64 vs UCRT64. Let's accommodate for that.

This fixes #6449
gitforwindowshelper Bot pushed a commit that referenced this pull request Oct 2, 2026
Currently, when running `GIT_CONFIG_GLOBAL=NUL git config --list`, it
fails with:

```
fatal: unable to access 'NUL': Invalid argument
```

The underlying reason is the different behavior of the C runtime used by
MINGW64 vs UCRT64. Let's accommodate for that.

This fixes #6449
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2.56.0 regression: GIT_CONFIG_GLOBAL=NUL fails with "unable to access 'NUL': Invalid argument"

2 participants