Skip to content

Commit fb5e337

Browse files
dschogitster
authored andcommitted
mingw: move Git for Windows' system config where users expect it
Git for Windows' prefix is `/mingw64/` (or `/mingw32/` for 32-bit versions), therefore the system config is located at the clunky location `C:\Program Files\Git\mingw64\etc\gitconfig`. 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`. 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`). Rather than fixing it back then, we tried to introduce a "Windows-wide" config, but that never caught on. Likewise, we move the system `gitattributes` into the same directory. 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]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ebf3c04 commit fb5e337

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
@@ -437,6 +437,11 @@ ifeq ($(uname_S),Windows)
437437
NO_POSIX_GOODIES = UnfortunatelyYes
438438
NATIVE_CRLF = YesPlease
439439
DEFAULT_HELP_FORMAT = html
440+
ifeq (/mingw64,$(subst 32,64,$(prefix)))
441+
# Move system config into top-level /etc/
442+
ETC_GITCONFIG = ../etc/gitconfig
443+
ETC_GITATTRIBUTES = ../etc/gitattributes
444+
endif
440445

441446
CC = compat/vcbuild/scripts/clink.pl
442447
AR = compat/vcbuild/scripts/lib.pl
@@ -671,6 +676,11 @@ else
671676
USE_LIBPCRE= YesPlease
672677
NO_CURL =
673678
USE_NED_ALLOCATOR = YesPlease
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)