Skip to content

Commit 8afdb3d

Browse files
dschoGit for Windows Build Agent
authored andcommitted
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 016facb commit 8afdb3d

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
@@ -425,6 +425,11 @@ ifeq ($(uname_S),Windows)
425425
NATIVE_CRLF = YesPlease
426426
INTERNAL_QSORT = YesPlease
427427
DEFAULT_HELP_FORMAT = html
428+
ifeq (/mingw64,$(subst 32,64,$(prefix)))
429+
# Move system config into top-level /etc/
430+
ETC_GITCONFIG = ../etc/gitconfig
431+
ETC_GITATTRIBUTES = ../etc/gitattributes
432+
endif
428433

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

0 commit comments

Comments
 (0)