# [PATCH 0/2] Remove MSys Support

16 messages from 2022-12-05 to 2023-02-02. Participants: Harshil Jani via GitGitGadget, Harshil-Jani via GitGitGadget, Junio C Hamano, Johannes Schindelin.
Thread: https://gitlist.dev/t/58901

## Harshil Jani via GitGitGadget, 2022-12-05 21:03

Subject: [PATCH 0/2] Remove MSys Support
Message-ID: <pull.1433.git.1670274213.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/pull.1433.git.1670274213.gitgitgadget%40gmail.com

```
I am trying to learn more about the git code base and came across the issue
where the support of MSys environment was to be dropped. This patch is my
first contribution towards it.

The msysGit and the MSys v1.x has been dropped into this patch and the
USE_NED_ALLOCATOR variable was duplicated here in the implementation so its
deduplication was also made in this patch.

Signed-off-by: Harshil-Jani harshiljani2002@gmail.com

Harshil-Jani (2):
  mingw: remove duplicate `USE_NED_ALLOCATOR` directive
  mingw: remove msysGit/MSYS1 support

 config.mak.uname | 86 ++++++++++++++++++++----------------------------
 1 file changed, 35 insertions(+), 51 deletions(-)


base-commit: 35a62bb5798092d491e6c7e688db6cb1418c9098
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1433%2FHarshil-Jani%2Fdrop-Msys-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1433/Harshil-Jani/drop-Msys-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1433
-- 
gitgitgadget

```

## Harshil-Jani via GitGitGadget, 2022-12-05 21:03

Subject: [PATCH 1/2] mingw: remove duplicate `USE_NED_ALLOCATOR` directive
Message-ID: <bc79dfcc4d44e0f006dc64d75a2c7f8a11834229.1670274213.git.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/bc79dfcc4d44e0f006dc64d75a2c7f8a11834229.1670274213.git.gitgitgadget%40gmail.com
In-Reply-To: <pull.1433.git.1670274213.gitgitgadget@gmail.com>

```
From: Harshil-Jani <harshiljani2002@gmail.com>

nedalloc was added to fix the slowness of memory allocator. Here
specifically for the MSys2 build there seems to be a duplication of
USE_NED_ALLOCATOR directive. So this patch intends to remove the
duplicate USE_NED_ALLOCATOR and keeping it only into the MSys2 config
section so it still uses the nedalloc.

Signed-off-by: Harshil-Jani <harshiljani2002@gmail.com>
---
 config.mak.uname | 1 -
 1 file changed, 1 deletion(-)

diff --git a/config.mak.uname b/config.mak.uname
index d63629fe807..377667c4bbc 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -652,7 +652,6 @@ ifeq ($(uname_S),MINGW)
 	USE_WIN32_IPC = YesPlease
 	USE_WIN32_MMAP = YesPlease
 	MMAP_PREVENTS_DELETE = UnfortunatelyYes
-	USE_NED_ALLOCATOR = YesPlease
 	UNRELIABLE_FSTAT = UnfortunatelyYes
 	OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
 	NO_REGEX = YesPlease
-- 
gitgitgadget


```

## Harshil-Jani via GitGitGadget, 2022-12-05 21:03

Subject: [PATCH 2/2] mingw: remove msysGit/MSYS1 support
Message-ID: <e6d3d280a4f9216aa6e9c3c83a38b0fb8ba3a8a1.1670274213.git.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/e6d3d280a4f9216aa6e9c3c83a38b0fb8ba3a8a1.1670274213.git.gitgitgadget%40gmail.com
In-Reply-To: <pull.1433.git.1670274213.gitgitgadget@gmail.com>

```
From: Harshil-Jani <harshiljani2002@gmail.com>

The msysGit (i.e. Git for Windows 1.x' SDK) is no longer used and the
last known user for MSys1 + MinGW has switched to MSys2. So there was no
reason to keep the msysGit/MSys1 config section. This Patch intends to
remove the support of both the builds and throw an error on
execution.

The output of `uname -r` if returns us with '1.' then it relates with MSys1
build environment and msysGit which we don't want to continue ahead and thus
an error can be expected.

The MSYS2 is currently used into the MinGW so we can get that part
running directly without any conditionals required.

Signed-off-by: Harshil-Jani <harshiljani2002@gmail.com>
---
 config.mak.uname | 85 ++++++++++++++++++++----------------------------
 1 file changed, 35 insertions(+), 50 deletions(-)

diff --git a/config.mak.uname b/config.mak.uname
index 377667c4bbc..965ec530837 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -623,6 +623,9 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
 	SHELL_PATH = /usr/coreutils/bin/bash
 endif
 ifeq ($(uname_S),MINGW)
+	ifeq ($(shell expr "$(uname_R)" : '1\.'),2)
+		$(error "Building with MSys is no longer supported")
+	endif
 	pathsep = ;
 	HAVE_ALLOCA_H = YesPlease
 	NO_PREAD = YesPlease
@@ -676,61 +679,43 @@ ifeq ($(uname_S),MINGW)
 	RC = windres -O coff
 	NATIVE_CRLF = YesPlease
 	X = .exe
-ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
-	htmldir = doc/git/html/
-	prefix =
+	# MSys2
+	prefix = /usr/
+	# Enable DEP
+	BASIC_LDFLAGS += -Wl,--nxcompat
+	# Enable ASLR (unless debugging)
+	ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS))))
+		BASIC_LDFLAGS += -Wl,--dynamicbase
+	endif
+	ifeq (MINGW32,$(MSYSTEM))
+		prefix = /mingw32
+		HOST_CPU = i686
+		BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup
+	endif
+	ifeq (MINGW64,$(MSYSTEM))
+		prefix = /mingw64
+		HOST_CPU = x86_64
+		BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
+	else
+		COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
+		BASIC_LDFLAGS += -Wl,--large-address-aware
+	endif
+	CC = gcc
+	COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
+		-fstack-protector-strong
+	EXTLIBS += -lntdll
 	INSTALL = /bin/install
-	EXTLIBS += /mingw/lib/libz.a
 	INTERNAL_QSORT = YesPlease
 	HAVE_LIBCHARSET_H = YesPlease
-	NO_GETTEXT = YesPlease
-	NO_PYTHON = YesPlease
-	COMPAT_CFLAGS += -D__USE_MINGW_ACCESS
-else
-	ifneq ($(shell expr "$(uname_R)" : '1\.'),2)
-		# MSys2
-		prefix = /usr/
-		# Enable DEP
-		BASIC_LDFLAGS += -Wl,--nxcompat
-		# Enable ASLR (unless debugging)
-		ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS))))
-			BASIC_LDFLAGS += -Wl,--dynamicbase
-		endif
-		ifeq (MINGW32,$(MSYSTEM))
-			prefix = /mingw32
-			HOST_CPU = i686
-			BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup
-		endif
-		ifeq (MINGW64,$(MSYSTEM))
-			prefix = /mingw64
-			HOST_CPU = x86_64
-			BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
-		else
-			COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
-			BASIC_LDFLAGS += -Wl,--large-address-aware
-		endif
-		CC = gcc
-		COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
-			-fstack-protector-strong
-		EXTLIBS += -lntdll
-		INSTALL = /bin/install
-		INTERNAL_QSORT = YesPlease
-		HAVE_LIBCHARSET_H = YesPlease
-		USE_GETTEXT_SCHEME = fallthrough
-		USE_LIBPCRE = YesPlease
-		USE_NED_ALLOCATOR = YesPlease
-		ifeq (/mingw64,$(subst 32,64,$(prefix)))
-			# Move system config into top-level /etc/
-			ETC_GITCONFIG = ../etc/gitconfig
-			ETC_GITATTRIBUTES = ../etc/gitattributes
-		endif
-	else
-		COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO
-		NO_CURL = YesPlease
-		NO_PYTHON = YesPlease
+	USE_GETTEXT_SCHEME = fallthrough
+	USE_LIBPCRE = YesPlease
+	USE_NED_ALLOCATOR = YesPlease
+	ifeq (/mingw64,$(subst 32,64,$(prefix)))
+		# Move system config into top-level /etc/
+		ETC_GITCONFIG = ../etc/gitconfig
+		ETC_GITATTRIBUTES = ../etc/gitattributes
 	endif
 endif
-endif
 ifeq ($(uname_S),QNX)
 	COMPAT_CFLAGS += -DSA_RESTART=0
 	EXPAT_NEEDS_XMLPARSE_H = YesPlease
-- 
gitgitgadget

```

## Junio C Hamano, 2022-12-18 01:54

Subject: Re: [PATCH 1/2] mingw: remove duplicate `USE_NED_ALLOCATOR` directive
Message-ID: <xmqq1qoxzdam.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq1qoxzdam.fsf%40gitster.g
In-Reply-To: <bc79dfcc4d44e0f006dc64d75a2c7f8a11834229.1670274213.git.gitgitgadget@gmail.com>

```
"Harshil-Jani via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Harshil-Jani <harshiljani2002@gmail.com>
>
> nedalloc was added to fix the slowness of memory allocator. Here
> specifically for the MSys2 build there seems to be a duplication of
> USE_NED_ALLOCATOR directive.

Yes, if your platform's "uname -S" says "MINGW", your build is done
in a directory with ../THIS_IS_MSYSGIT marker file, and your "uname -R"
does not begin with "1.", then there are two USE_NED_ALLOCATOR=YesPlease
in effect.

> So this patch intends to remove the
> duplicate USE_NED_ALLOCATOR and keeping it only into the MSys2 config
> section so it still uses the nedalloc.

What about other folks whose "uname -S" says "MINGW"?

> Signed-off-by: Harshil-Jani <harshiljani2002@gmail.com>
> ---
>  config.mak.uname | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/config.mak.uname b/config.mak.uname
> index d63629fe807..377667c4bbc 100644
> --- a/config.mak.uname
> +++ b/config.mak.uname
> @@ -652,7 +652,6 @@ ifeq ($(uname_S),MINGW)
>  	USE_WIN32_IPC = YesPlease
>  	USE_WIN32_MMAP = YesPlease
>  	MMAP_PREVENTS_DELETE = UnfortunatelyYes
> -	USE_NED_ALLOCATOR = YesPlease
>  	UNRELIABLE_FSTAT = UnfortunatelyYes
>  	OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
>  	NO_REGEX = YesPlease

The original in a wider context looks like this:

        ifeq ($(uname_S),MINGW)
                ...
                MMAP_PREVENTS_DELETE = UnfortunatelyYes
                USE_NED_ALLOCATOR = YesPlease
                UNRELIABLE_FSTAT = UnfortunatelyYes
                ...
                X = .exe
        ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
                htmldir = doc/git/html/
                ...
                COMPAT_CFLAGS += -D__USE_MINGW_ACCESS
        else
                ifneq ($(shell expr "$(uname_R)" : '1\.'),2)
                        # MSys2
                        ...
                        USE_LIBPCRE = YesPlease
                        USE_NED_ALLOCATOR = YesPlease
                        ifeq (/mingw64,$(subst 32,64,$(prefix)))
                                # Move system config into top-level /etc/
                                ...
                        endif
                else
                        ...
                endif
        endif
        endif

With this patch, a build that has ../THIS_IS_MSYSGIT marker file, or
whose "uname -R" output begins with "1.", will no longer get
USE_NED_ALLOCATOR.  Intended?

Without knowing much about the Windows/MSYS/Git for Windows SDK
ecosystem, it is the inner one that looks duplicated, but the patch
is removing the outer one that helps every platform whose "uname -S"
identifies it as MINGW.

Perhaps that is what the patch meant to do, but then the proposed
log message explains it very differently.  It only talks about the
no-op case.  It does not explain why other folks whose "uname -S"
says MINGW (1) are not broken if this patch suddenly robs NED
allocator from them, and (2) are better off without using NED
allocator.

```

## Junio C Hamano, 2022-12-18 02:11

Subject: Re: [PATCH 2/2] mingw: remove msysGit/MSYS1 support
Message-ID: <xmqqsfhdxxyj.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqsfhdxxyj.fsf%40gitster.g
In-Reply-To: <e6d3d280a4f9216aa6e9c3c83a38b0fb8ba3a8a1.1670274213.git.gitgitgadget@gmail.com>

```
"Harshil-Jani via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Harshil-Jani <harshiljani2002@gmail.com>
>
> The msysGit (i.e. Git for Windows 1.x' SDK) is no longer used and the
> last known user for MSys1 + MinGW has switched to MSys2.

It is curious that we can speak with such a certainty of the lack of
users of such a popular project.  References?

> So there was no
> reason to keep the msysGit/MSys1 config section. This Patch intends to
> remove the support of both the builds and throw an error on
> execution.
>
> The output of `uname -r` if returns us with '1.' then it relates with MSys1
> build environment and msysGit which we don't want to continue ahead and thus
> an error can be expected.

The above clearly explains what is written in the patch text, but
the proposed log message does not explain what ../THIS_IS_MSYSGIT
used to guard and why now we can remove it.

> The MSYS2 is currently used into the MinGW so we can get that part
> running directly without any conditionals required.
>
> Signed-off-by: Harshil-Jani <harshiljani2002@gmail.com>
> ---
>  config.mak.uname | 85 ++++++++++++++++++++----------------------------
>  1 file changed, 35 insertions(+), 50 deletions(-)

Thanks.  It always is good to see more lines go away ;-) but these
two patches need to be explained a bit better and supported by folks
who have been active on Windows port of the project.

> diff --git a/config.mak.uname b/config.mak.uname
> index 377667c4bbc..965ec530837 100644
> --- a/config.mak.uname
> +++ b/config.mak.uname
> @@ -623,6 +623,9 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
>  	SHELL_PATH = /usr/coreutils/bin/bash
>  endif
>  ifeq ($(uname_S),MINGW)
> +	ifeq ($(shell expr "$(uname_R)" : '1\.'),2)
> +		$(error "Building with MSys is no longer supported")
> +	endif
>  	pathsep = ;
>  	HAVE_ALLOCA_H = YesPlease
>  	NO_PREAD = YesPlease
> @@ -676,61 +679,43 @@ ifeq ($(uname_S),MINGW)
>  	RC = windres -O coff
>  	NATIVE_CRLF = YesPlease
>  	X = .exe
> -ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
> -	htmldir = doc/git/html/
> -	prefix =
> +	# MSys2
> +	prefix = /usr/
> +	# Enable DEP
> +	BASIC_LDFLAGS += -Wl,--nxcompat
> +	# Enable ASLR (unless debugging)
> +	ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS))))
> +		BASIC_LDFLAGS += -Wl,--dynamicbase
> +	endif
> +	ifeq (MINGW32,$(MSYSTEM))
> +		prefix = /mingw32
> +		HOST_CPU = i686
> +		BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup
> +	endif
> +	ifeq (MINGW64,$(MSYSTEM))
> +		prefix = /mingw64
> +		HOST_CPU = x86_64
> +		BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
> +	else
> +		COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
> +		BASIC_LDFLAGS += -Wl,--large-address-aware
> +	endif
> +	CC = gcc
> +	COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
> +		-fstack-protector-strong
> +	EXTLIBS += -lntdll
>  	INSTALL = /bin/install
> -	EXTLIBS += /mingw/lib/libz.a
>  	INTERNAL_QSORT = YesPlease
>  	HAVE_LIBCHARSET_H = YesPlease
> -	NO_GETTEXT = YesPlease
> -	NO_PYTHON = YesPlease
> -	COMPAT_CFLAGS += -D__USE_MINGW_ACCESS
> -else
> -	ifneq ($(shell expr "$(uname_R)" : '1\.'),2)
> -		# MSys2
> -		prefix = /usr/
> -		# Enable DEP
> -		BASIC_LDFLAGS += -Wl,--nxcompat
> -		# Enable ASLR (unless debugging)
> -		ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS))))
> -			BASIC_LDFLAGS += -Wl,--dynamicbase
> -		endif
> -		ifeq (MINGW32,$(MSYSTEM))
> -			prefix = /mingw32
> -			HOST_CPU = i686
> -			BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup
> -		endif
> -		ifeq (MINGW64,$(MSYSTEM))
> -			prefix = /mingw64
> -			HOST_CPU = x86_64
> -			BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
> -		else
> -			COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
> -			BASIC_LDFLAGS += -Wl,--large-address-aware
> -		endif
> -		CC = gcc
> -		COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
> -			-fstack-protector-strong
> -		EXTLIBS += -lntdll
> -		INSTALL = /bin/install
> -		INTERNAL_QSORT = YesPlease
> -		HAVE_LIBCHARSET_H = YesPlease
> -		USE_GETTEXT_SCHEME = fallthrough
> -		USE_LIBPCRE = YesPlease
> -		USE_NED_ALLOCATOR = YesPlease
> -		ifeq (/mingw64,$(subst 32,64,$(prefix)))
> -			# Move system config into top-level /etc/
> -			ETC_GITCONFIG = ../etc/gitconfig
> -			ETC_GITATTRIBUTES = ../etc/gitattributes
> -		endif
> -	else
> -		COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO
> -		NO_CURL = YesPlease
> -		NO_PYTHON = YesPlease
> +	USE_GETTEXT_SCHEME = fallthrough
> +	USE_LIBPCRE = YesPlease
> +	USE_NED_ALLOCATOR = YesPlease
> +	ifeq (/mingw64,$(subst 32,64,$(prefix)))
> +		# Move system config into top-level /etc/
> +		ETC_GITCONFIG = ../etc/gitconfig
> +		ETC_GITATTRIBUTES = ../etc/gitattributes
>  	endif
>  endif
> -endif
>  ifeq ($(uname_S),QNX)
>  	COMPAT_CFLAGS += -DSA_RESTART=0
>  	EXPAT_NEEDS_XMLPARSE_H = YesPlease

```

## Junio C Hamano, 2022-12-18 02:15

Subject: Re: [PATCH 0/2] Remove MSys Support
Message-ID: <xmqqmt7lxxr6.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqmt7lxxr6.fsf%40gitster.g
In-Reply-To: <pull.1433.git.1670274213.gitgitgadget@gmail.com>

```
"Harshil Jani via GitGitGadget" <gitgitgadget@gmail.com> writes:

> The msysGit and the MSys v1.x has been dropped into this patch and the
> USE_NED_ALLOCATOR variable was duplicated here in the implementation so its
> deduplication was also made in this patch.
>
> Signed-off-by: Harshil-Jani harshiljani2002@gmail.com

Thanks, Harshil.

I do not do Windows, so I sent a few drive-by comments to suggest
improvements that may help to make the patch more understandable,
but more importantly, I did not see the patch asking input from
anybody who have worked on the port of Git to the Window system, so
I ran the following

$ git shortlog -sn --no-merges v2.39.0 -- compat/win\*\* compat/mingw.\* | head -5
   100	Johannes Schindelin
    56	Johannes Sixt
    41	Karsten Blees
    23	Erik Faye-Lund
    13	Jeff Hostetler

and then picked those names we still often see on the list to
attract their attention.


```

## Junio C Hamano, 2022-12-18 03:58

Subject: Re: [PATCH 2/2] mingw: remove msysGit/MSYS1 support
Message-ID: <xmqq4jttxt0u.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq4jttxt0u.fsf%40gitster.g
In-Reply-To: <xmqqsfhdxxyj.fsf@gitster.g>

```
Junio C Hamano <gitster@pobox.com> writes:

> "Harshil-Jani via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> From: Harshil-Jani <harshiljani2002@gmail.com>
>>
>> The msysGit (i.e. Git for Windows 1.x' SDK) is no longer used and the
>> last known user for MSys1 + MinGW has switched to MSys2.
>
> It is curious that we can speak with such a certainty of the lack of
> users of such a popular project.  References?

I see J6t mentioning about such a switch,

  https://lore.kernel.org/git/c9aec5b6-0a78-a580-3658-5189bd2075a6@kdbg.org/

but I do not know if it is sensible to claim that this was the last
known user switching away.  Perhaps

    Last time the code around here was modified, which eventually
    led to 49d279f8 (windows: include the Python bits when building
    Git for Windows, 2022-07-29), the change was carefully written
    to keep things unchanged for Msys1, as at least one user
    (Johannes Sixt) who did crucial work to support Git on Windows
    and we did not want to break Msys1 (yet).  In the discussion J6t
    confirmed that he no longer is on Msys1 (cf. [*1*]).

to replace the paragraph, with this at the end

    [References]
    *1* https://lore.kernel.org/git/c9aec5b6-0a78-a580-3658-5189bd2075a6@kdbg.org/)

explain the change (be sure to explain ../THIS_IS_MSYSGIT bit, too,
not just the $(uname_R) bit), and then throw in something like

    There may be users other than J6t who needs a working Msys1, but
    we can revert this patch if it becomes necessary (i.e. when they
    complain).

somewhere?

Thanks.

```

## Johannes Schindelin, 2023-01-09 07:36

Subject: Re: [PATCH 0/2] Remove MSys Support
Message-ID: <9933d992-ffd3-b43c-559e-0de819408cda@gmx.de>
URL: https://gitlist.dev/e/9933d992-ffd3-b43c-559e-0de819408cda%40gmx.de
In-Reply-To: <xmqqmt7lxxr6.fsf@gitster.g>

```
Hi Junio,

On Sun, 18 Dec 2022, Junio C Hamano wrote:

> "Harshil Jani via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > The msysGit and the MSys v1.x has been dropped into this patch and the
> > USE_NED_ALLOCATOR variable was duplicated here in the implementation so its
> > deduplication was also made in this patch.
> >
> > Signed-off-by: Harshil-Jani harshiljani2002@gmail.com
>
> Thanks, Harshil.
>
> I do not do Windows, so I sent a few drive-by comments to suggest
> improvements that may help to make the patch more understandable,
> but more importantly, I did not see the patch asking input from
> anybody who have worked on the port of Git to the Window system, so
> I ran the following
>
> $ git shortlog -sn --no-merges v2.39.0 -- compat/win\*\* compat/mingw.\* | head -5
>    100	Johannes Schindelin
>     56	Johannes Sixt
>     41	Karsten Blees
>     23	Erik Faye-Lund
>     13	Jeff Hostetler
>
> and then picked those names we still often see on the list to
> attract their attention.

I need to note that Harshil and I have been communicating about this
patch before it was submitted. So here is my explicit ACK.

Ciao,
Johannes

```

## Johannes Schindelin, 2023-01-09 07:48

Subject: Re: [PATCH 2/2] mingw: remove msysGit/MSYS1 support
Message-ID: <4a2ce224-85e4-5903-44bc-664aa5a59f91@gmx.de>
URL: https://gitlist.dev/e/4a2ce224-85e4-5903-44bc-664aa5a59f91%40gmx.de
In-Reply-To: <xmqq4jttxt0u.fsf@gitster.g>

```
Hi,

On Sun, 18 Dec 2022, Junio C Hamano wrote:

> Junio C Hamano <gitster@pobox.com> writes:
>
> > "Harshil-Jani via GitGitGadget" <gitgitgadget@gmail.com> writes:
> >
> >> From: Harshil-Jani <harshiljani2002@gmail.com>
> >>
> >> The msysGit (i.e. Git for Windows 1.x' SDK) is no longer used and the
> >> last known user for MSys1 + MinGW has switched to MSys2.
> >
> > It is curious that we can speak with such a certainty of the lack of
> > users of such a popular project.  References?
>
> I see J6t mentioning about such a switch,
>
>   https://lore.kernel.org/git/c9aec5b6-0a78-a580-3658-5189bd2075a6@kdbg.org/
>
> but I do not know if it is sensible to claim that this was the last
> known user switching away.  Perhaps
>
>     Last time the code around here was modified, which eventually
>     led to 49d279f8 (windows: include the Python bits when building
>     Git for Windows, 2022-07-29), the change was carefully written
>     to keep things unchanged for Msys1, as at least one user
>     (Johannes Sixt) who did crucial work to support Git on Windows
>     and we did not want to break Msys1 (yet).  In the discussion J6t
>     confirmed that he no longer is on Msys1 (cf. [*1*]).

It would be good to avoid over-indexing on individual person's
preferences. While it seems to be quite common in the Git project, it is
obvious how this harms the Git project more than e.g. focusing on users'
needs would.

A more productive line of thought would therefore be:

	MSys has long fallen behind MSYS2 in features like Unicode or
	x86_64 support or even security bug fixes, and is therefore no
	longer used by anyone in the Git developer community. The Git for
	Windows project itself started switching from MSys to MSYS2 early
	in 2015, i.e. about eight years ago. Let's drop supporting MSys as
	a development platform.

Ciao,
Johannes

>
> to replace the paragraph, with this at the end
>
>     [References]
>     *1* https://lore.kernel.org/git/c9aec5b6-0a78-a580-3658-5189bd2075a6@kdbg.org/)
>
> explain the change (be sure to explain ../THIS_IS_MSYSGIT bit, too,
> not just the $(uname_R) bit), and then throw in something like
>
>     There may be users other than J6t who needs a working Msys1, but
>     we can revert this patch if it becomes necessary (i.e. when they
>     complain).
>
> somewhere?
>
> Thanks.
>

```

## Junio C Hamano, 2023-01-09 08:49

Subject: Re: [PATCH 0/2] Remove MSys Support
Message-ID: <xmqq7cxwum6i.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq7cxwum6i.fsf%40gitster.g
In-Reply-To: <9933d992-ffd3-b43c-559e-0de819408cda@gmx.de>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> I need to note that Harshil and I have been communicating about this
> patch before it was submitted. So here is my explicit ACK.

Excellent.  Thanks.

```

## Junio C Hamano, 2023-01-09 08:52

Subject: Re: [PATCH 2/2] mingw: remove msysGit/MSYS1 support
Message-ID: <xmqq358kum22.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq358kum22.fsf%40gitster.g
In-Reply-To: <4a2ce224-85e4-5903-44bc-664aa5a59f91@gmx.de>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> It would be good to avoid over-indexing on individual person's
> preferences. While it seems to be quite common in the Git project, it is
> obvious how this harms the Git project more than e.g. focusing on users'
> needs would.
>
> A more productive line of thought would therefore be:
>
> 	MSys has long fallen behind MSYS2 in features like Unicode or
> 	x86_64 support or even security bug fixes, and is therefore no
> 	longer used by anyone in the Git developer community. The Git for
> 	Windows project itself started switching from MSys to MSYS2 early
> 	in 2015, i.e. about eight years ago. Let's drop supporting MSys as
> 	a development platform.

Nicely written.

Will expect a reroll with Acked-by: added with updated description,
hopefully by the end of the week when I'll come back online?

Thanks.


```

## Harshil Jani via GitGitGadget, 2023-02-02 03:51

Subject: [PATCH v2 0/2] Remove MSys Support
Message-ID: <pull.1433.v2.git.1675309898.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/pull.1433.v2.git.1675309898.gitgitgadget%40gmail.com
In-Reply-To: <pull.1433.git.1670274213.gitgitgadget@gmail.com>

```
I am trying to learn more about the git code base and came across the issue
where the support of MSys environment was to be dropped. This patch is my
first contribution towards it.

The msysGit and the MSys v1.x has been dropped into this patch and the
USE_NED_ALLOCATOR variable was duplicated here in the implementation so its
deduplication was also made in this patch.

Signed-off-by: Harshil-Jani harshiljani2002@gmail.com

Harshil-Jani (2):
  mingw: remove duplicate `USE_NED_ALLOCATOR` directive
  mingw: remove msysGit/MSYS1 support

 config.mak.uname | 86 ++++++++++++++++++++----------------------------
 1 file changed, 35 insertions(+), 51 deletions(-)


base-commit: 35a62bb5798092d491e6c7e688db6cb1418c9098
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1433%2FHarshil-Jani%2Fdrop-Msys-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1433/Harshil-Jani/drop-Msys-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/1433

Range-diff vs v1:

 1:  bc79dfcc4d4 = 1:  bc79dfcc4d4 mingw: remove duplicate `USE_NED_ALLOCATOR` directive
 2:  e6d3d280a4f ! 2:  0c0289343fb mingw: remove msysGit/MSYS1 support
     @@ Metadata
       ## Commit message ##
          mingw: remove msysGit/MSYS1 support
      
     -    The msysGit (i.e. Git for Windows 1.x' SDK) is no longer used and the
     -    last known user for MSys1 + MinGW has switched to MSys2. So there was no
     -    reason to keep the msysGit/MSys1 config section. This Patch intends to
     -    remove the support of both the builds and throw an error on
     -    execution.
     -
     -    The output of `uname -r` if returns us with '1.' then it relates with MSys1
     -    build environment and msysGit which we don't want to continue ahead and thus
     -    an error can be expected.
     -
     -    The MSYS2 is currently used into the MinGW so we can get that part
     -    running directly without any conditionals required.
     +    MSys has long fallen behind MSYS2 in features like Unicode or
     +    x86_64 support or even security bug fixes, and is therefore no
     +    longer used by anyone in the Git developer community. The Git for
     +    Windows project itself started switching from MSys to MSYS2 early
     +    in 2015, i.e. about eight years ago. Let's drop supporting MSys as
     +    a development platform.
      
          Signed-off-by: Harshil-Jani <harshiljani2002@gmail.com>
      

-- 
gitgitgadget

```

## Harshil-Jani via GitGitGadget, 2023-02-02 03:51

Subject: [PATCH v2 1/2] mingw: remove duplicate `USE_NED_ALLOCATOR` directive
Message-ID: <bc79dfcc4d44e0f006dc64d75a2c7f8a11834229.1675309898.git.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/bc79dfcc4d44e0f006dc64d75a2c7f8a11834229.1675309898.git.gitgitgadget%40gmail.com
In-Reply-To: <pull.1433.v2.git.1675309898.gitgitgadget@gmail.com>

```
From: Harshil-Jani <harshiljani2002@gmail.com>

nedalloc was added to fix the slowness of memory allocator. Here
specifically for the MSys2 build there seems to be a duplication of
USE_NED_ALLOCATOR directive. So this patch intends to remove the
duplicate USE_NED_ALLOCATOR and keeping it only into the MSys2 config
section so it still uses the nedalloc.

Signed-off-by: Harshil-Jani <harshiljani2002@gmail.com>
---
 config.mak.uname | 1 -
 1 file changed, 1 deletion(-)

diff --git a/config.mak.uname b/config.mak.uname
index d63629fe807..377667c4bbc 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -652,7 +652,6 @@ ifeq ($(uname_S),MINGW)
 	USE_WIN32_IPC = YesPlease
 	USE_WIN32_MMAP = YesPlease
 	MMAP_PREVENTS_DELETE = UnfortunatelyYes
-	USE_NED_ALLOCATOR = YesPlease
 	UNRELIABLE_FSTAT = UnfortunatelyYes
 	OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
 	NO_REGEX = YesPlease
-- 
gitgitgadget


```

## Harshil-Jani via GitGitGadget, 2023-02-02 03:51

Subject: [PATCH v2 2/2] mingw: remove msysGit/MSYS1 support
Message-ID: <0c0289343fb086c19831bdd38707e94ad2cb60e3.1675309898.git.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/0c0289343fb086c19831bdd38707e94ad2cb60e3.1675309898.git.gitgitgadget%40gmail.com
In-Reply-To: <pull.1433.v2.git.1675309898.gitgitgadget@gmail.com>

```
From: Harshil-Jani <harshiljani2002@gmail.com>

MSys has long fallen behind MSYS2 in features like Unicode or
x86_64 support or even security bug fixes, and is therefore no
longer used by anyone in the Git developer community. The Git for
Windows project itself started switching from MSys to MSYS2 early
in 2015, i.e. about eight years ago. Let's drop supporting MSys as
a development platform.

Signed-off-by: Harshil-Jani <harshiljani2002@gmail.com>
---
 config.mak.uname | 85 ++++++++++++++++++++----------------------------
 1 file changed, 35 insertions(+), 50 deletions(-)

diff --git a/config.mak.uname b/config.mak.uname
index 377667c4bbc..965ec530837 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -623,6 +623,9 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
 	SHELL_PATH = /usr/coreutils/bin/bash
 endif
 ifeq ($(uname_S),MINGW)
+	ifeq ($(shell expr "$(uname_R)" : '1\.'),2)
+		$(error "Building with MSys is no longer supported")
+	endif
 	pathsep = ;
 	HAVE_ALLOCA_H = YesPlease
 	NO_PREAD = YesPlease
@@ -676,61 +679,43 @@ ifeq ($(uname_S),MINGW)
 	RC = windres -O coff
 	NATIVE_CRLF = YesPlease
 	X = .exe
-ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
-	htmldir = doc/git/html/
-	prefix =
+	# MSys2
+	prefix = /usr/
+	# Enable DEP
+	BASIC_LDFLAGS += -Wl,--nxcompat
+	# Enable ASLR (unless debugging)
+	ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS))))
+		BASIC_LDFLAGS += -Wl,--dynamicbase
+	endif
+	ifeq (MINGW32,$(MSYSTEM))
+		prefix = /mingw32
+		HOST_CPU = i686
+		BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup
+	endif
+	ifeq (MINGW64,$(MSYSTEM))
+		prefix = /mingw64
+		HOST_CPU = x86_64
+		BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
+	else
+		COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
+		BASIC_LDFLAGS += -Wl,--large-address-aware
+	endif
+	CC = gcc
+	COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
+		-fstack-protector-strong
+	EXTLIBS += -lntdll
 	INSTALL = /bin/install
-	EXTLIBS += /mingw/lib/libz.a
 	INTERNAL_QSORT = YesPlease
 	HAVE_LIBCHARSET_H = YesPlease
-	NO_GETTEXT = YesPlease
-	NO_PYTHON = YesPlease
-	COMPAT_CFLAGS += -D__USE_MINGW_ACCESS
-else
-	ifneq ($(shell expr "$(uname_R)" : '1\.'),2)
-		# MSys2
-		prefix = /usr/
-		# Enable DEP
-		BASIC_LDFLAGS += -Wl,--nxcompat
-		# Enable ASLR (unless debugging)
-		ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS))))
-			BASIC_LDFLAGS += -Wl,--dynamicbase
-		endif
-		ifeq (MINGW32,$(MSYSTEM))
-			prefix = /mingw32
-			HOST_CPU = i686
-			BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup
-		endif
-		ifeq (MINGW64,$(MSYSTEM))
-			prefix = /mingw64
-			HOST_CPU = x86_64
-			BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup
-		else
-			COMPAT_CFLAGS += -D_USE_32BIT_TIME_T
-			BASIC_LDFLAGS += -Wl,--large-address-aware
-		endif
-		CC = gcc
-		COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
-			-fstack-protector-strong
-		EXTLIBS += -lntdll
-		INSTALL = /bin/install
-		INTERNAL_QSORT = YesPlease
-		HAVE_LIBCHARSET_H = YesPlease
-		USE_GETTEXT_SCHEME = fallthrough
-		USE_LIBPCRE = YesPlease
-		USE_NED_ALLOCATOR = YesPlease
-		ifeq (/mingw64,$(subst 32,64,$(prefix)))
-			# Move system config into top-level /etc/
-			ETC_GITCONFIG = ../etc/gitconfig
-			ETC_GITATTRIBUTES = ../etc/gitattributes
-		endif
-	else
-		COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO
-		NO_CURL = YesPlease
-		NO_PYTHON = YesPlease
+	USE_GETTEXT_SCHEME = fallthrough
+	USE_LIBPCRE = YesPlease
+	USE_NED_ALLOCATOR = YesPlease
+	ifeq (/mingw64,$(subst 32,64,$(prefix)))
+		# Move system config into top-level /etc/
+		ETC_GITCONFIG = ../etc/gitconfig
+		ETC_GITATTRIBUTES = ../etc/gitattributes
 	endif
 endif
-endif
 ifeq ($(uname_S),QNX)
 	COMPAT_CFLAGS += -DSA_RESTART=0
 	EXPAT_NEEDS_XMLPARSE_H = YesPlease
-- 
gitgitgadget

```

## Johannes Schindelin, 2023-02-02 13:59

Subject: Re: [PATCH v2 0/2] Remove MSys Support
Message-ID: <a4ce7778-c108-99ff-f97e-2ebb8cb605aa@gmx.de>
URL: https://gitlist.dev/e/a4ce7778-c108-99ff-f97e-2ebb8cb605aa%40gmx.de
In-Reply-To: <pull.1433.v2.git.1675309898.gitgitgadget@gmail.com>

```
Hi Harshil,

On Thu, 2 Feb 2023, Harshil Jani via GitGitGadget wrote:

> Range-diff vs v1:
>
>  1:  bc79dfcc4d4 = 1:  bc79dfcc4d4 mingw: remove duplicate `USE_NED_ALLOCATOR` directive
>  2:  e6d3d280a4f ! 2:  0c0289343fb mingw: remove msysGit/MSYS1 support
>      @@ Metadata
>        ## Commit message ##
>           mingw: remove msysGit/MSYS1 support
>
>      -    The msysGit (i.e. Git for Windows 1.x' SDK) is no longer used and the
>      -    last known user for MSys1 + MinGW has switched to MSys2. So there was no
>      -    reason to keep the msysGit/MSys1 config section. This Patch intends to
>      -    remove the support of both the builds and throw an error on
>      -    execution.
>      -
>      -    The output of `uname -r` if returns us with '1.' then it relates with MSys1
>      -    build environment and msysGit which we don't want to continue ahead and thus
>      -    an error can be expected.
>      -
>      -    The MSYS2 is currently used into the MinGW so we can get that part
>      -    running directly without any conditionals required.
>      +    MSys has long fallen behind MSYS2 in features like Unicode or
>      +    x86_64 support or even security bug fixes, and is therefore no
>      +    longer used by anyone in the Git developer community. The Git for
>      +    Windows project itself started switching from MSys to MSYS2 early
>      +    in 2015, i.e. about eight years ago. Let's drop supporting MSys as
>      +    a development platform.
>
>           Signed-off-by: Harshil-Jani <harshiljani2002@gmail.com>

This seems to address Junio's concern.

I'm fine with these patches, too. Here's my ACK.

Ciao,
Johannes

```

## Junio C Hamano, 2023-02-02 16:06

Subject: Re: [PATCH v2 0/2] Remove MSys Support
Message-ID: <xmqqlelgvyp5.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqlelgvyp5.fsf%40gitster.g
In-Reply-To: <a4ce7778-c108-99ff-f97e-2ebb8cb605aa@gmx.de>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> I'm fine with these patches, too. Here's my ACK.

Thanks, will re-queue with your ack.

```
