Skip to content

Commit 83d339a

Browse files
committed
mingw: prepare for making git config --system do what users expect
This moves the system config into a more logical location: the `mingw64` part of `C:\Program Files\Git\mingw64\etc\gitconfig` never made sense, as it is a mere implementation detail. Let's skip the `mingw64` part and move this to `C:\Program Files\Git\etc\gitconfig`. Side note: in the rare (and not recommended) case a user chooses to install 32-bit Git for Windows on a 64-bit system, the path will of course be `C:\Program Files (x86)\Git\etc\gitconfig`. The next step after this patch is to scrap support for `C:\ProgramData\Git\config`, which never really made sense to users, and which is inconsistent with non-Windows versions of Git, anyway. Background: During the Git for Windows v1.x days, the system config was located at `C:\Program Files (x86)\Git\etc\gitconfig`. With Git for Windows v2.x, it moved to `C:\Program Files\Git\mingw64\gitconfig` (or `C:\Program Files (x86)\Git\mingw32\gitconfig`). Obviously, this new location was not stable (because of the "mingw64" part) and this maintainer thought that it was a splendid time to introduce a "super-system" config, with a constant location, that would be shared by all Git implementations. Hence `C:\ProgramData\Git\config` was born. What we *should* have done instead is to move the location to the top-level `etc` directory instead of the `mingw64\etc` one (or `mingw32\etc` for 32-bit versions). Likewise, we should have treated the system `gitattributes` in a similar manner. This patch makes it so. Obviously, we are cautious to do this only for the known install locations `/mingw64` and `/mingw32`; If anybody wants to override that while building their version of Git (e.g. via `make prefix=$HOME`), we leave the default location of the system config and gitattributes alone. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 8612168 commit 83d339a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

config.mak.uname

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,11 @@ ifeq ($(uname_S),Windows)
424424
NO_POSIX_GOODIES = UnfortunatelyYes
425425
NATIVE_CRLF = YesPlease
426426
DEFAULT_HELP_FORMAT = html
427+
ifeq (/mingw64,$(subst 32,64,$(prefix)))
428+
# Move system config into top-level /etc/
429+
ETC_GITCONFIG = ../etc/gitconfig
430+
ETC_GITATTRIBUTES = ../etc/gitattributes
431+
endif
427432

428433
CC = compat/vcbuild/scripts/clink.pl
429434
AR = compat/vcbuild/scripts/lib.pl
@@ -670,6 +675,11 @@ else
670675
NO_CURL =
671676
USE_NED_ALLOCATOR = YesPlease
672677
NO_PYTHON =
678+
ifeq (/mingw64,$(subst 32,64,$(prefix)))
679+
# Move system config into top-level /etc/
680+
ETC_GITCONFIG = ../etc/gitconfig
681+
ETC_GITATTRIBUTES = ../etc/gitattributes
682+
endif
673683
else
674684
COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO
675685
NO_CURL = YesPlease

0 commit comments

Comments
 (0)