git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 4/4] mingw: support Windows Server 2016 again

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Aug 3, 2025, 21:25 UTC
Message-ID
<51113ab9b81555387d5c4083b3c0ec3b0c2d2596.1754256318.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1948.git.1754256318.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

It was reported to the Git for Windows project that a simple `git init` fails on Windows Server 2016:

  D:\Dev\test> git init
  error: could not write config file D:/Dev/test/.git/config: Function not implemented
  fatal: could not set 'core.repositoryformatversion' to '0'

According to https://endoflife.date/windows-server, Windows Server 2016 is officially supported for another one-and-a-half years as of time of writing, so this is not good.

The culprit is the `mingw_rename()` changes that try to use POSIX semantics when available, but fail to fall back properly on Windows Server 2016.

This fixes https://github.com/git-for-windows/git/issues/5695.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 compat/mingw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/compat/mingw.c b/compat/mingw.c
index d53ce38b7f82..8538e3d1729d 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -2277,7 +2277,9 @@ repeat:
 		 * current system doesn't support FileRenameInfoEx. Keep us
 		 * from using it in future calls and retry.
 		 */
-		if (gle == ERROR_INVALID_PARAMETER || gle == ERROR_NOT_SUPPORTED) {
+		if (gle == ERROR_INVALID_PARAMETER ||
+		    gle == ERROR_NOT_SUPPORTED ||
+		    gle == ERROR_INVALID_FUNCTION) {
 			supports_file_rename_info_ex = 0;
 			goto repeat;
 		}
-- 
gitgitgadget
Previous: Johannes Schindelin via GitGitGadgetNext: Junio C Hamano
Message 6 of 7 in “mingw: rename and open fixes”
  1. 0/4 mingw: rename and open fixesJohannes Schindelin via GitGitGadget, Aug 3, 2025
  2. 1/4 mingw_open_existing: handle directories betterMatthias Aßhauer via GitGitGadget, Aug 3, 2025
  3. 2/4 mingw: drop Windows 7-specific work-aroundJohannes Schindelin via GitGitGadget, Aug 3, 2025
  4. Oswald BuddenhagenAug 4, 2025
  5. 3/4 mingw_rename: support ReFS on Windows 2022Johannes Schindelin via GitGitGadget, Aug 3, 2025
  6. 4/4 mingw: support Windows Server 2016 againJohannes Schindelin via GitGitGadget, Aug 3, 2025
  7. Junio C HamanoAug 4, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.