Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Git for Windows' system config to its top-level directory's etc/ #984

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions config.c
Expand Up @@ -1833,9 +1833,10 @@ static int git_config_from_blob_ref(config_fn_t fn,
char *git_system_config(void)
{
char *system_config = xstrdup_or_null(getenv("GIT_CONFIG_SYSTEM"));
if (system_config)
return system_config;
return system_path(ETC_GITCONFIG);
if (!system_config)
system_config = system_path(ETC_GITCONFIG);
normalize_path_copy(system_config, system_config);
return system_config;
}

void git_global_config(char **user_out, char **xdg_out)
Expand Down
10 changes: 10 additions & 0 deletions config.mak.uname
Expand Up @@ -437,6 +437,11 @@ ifeq ($(uname_S),Windows)
NO_POSIX_GOODIES = UnfortunatelyYes
NATIVE_CRLF = YesPlease
DEFAULT_HELP_FORMAT = html
ifeq (/mingw64,$(subst 32,64,$(prefix)))
# Move system config into top-level /etc/
ETC_GITCONFIG = ../etc/gitconfig
ETC_GITATTRIBUTES = ../etc/gitattributes
endif

CC = compat/vcbuild/scripts/clink.pl
AR = compat/vcbuild/scripts/lib.pl
Expand Down Expand Up @@ -671,6 +676,11 @@ else
USE_LIBPCRE= YesPlease
NO_CURL =
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
Expand Down
11 changes: 7 additions & 4 deletions contrib/buildsystems/CMakeLists.txt
Expand Up @@ -204,8 +204,6 @@ list(APPEND compat_SOURCES sha1dc_git.c sha1dc/sha1.c sha1dc/ubc_check.c block-s


add_compile_definitions(PAGER_ENV="LESS=FRX LV=-c"
ETC_GITATTRIBUTES="etc/gitattributes"
ETC_GITCONFIG="etc/gitconfig"
GIT_EXEC_PATH="libexec/git-core"
GIT_LOCALE_PATH="share/locale"
GIT_MAN_PATH="share/man"
Expand All @@ -220,10 +218,15 @@ add_compile_definitions(PAGER_ENV="LESS=FRX LV=-c"

if(WIN32)
set(FALLBACK_RUNTIME_PREFIX /mingw64)
add_compile_definitions(FALLBACK_RUNTIME_PREFIX="${FALLBACK_RUNTIME_PREFIX}")
# Move system config into top-level /etc/
add_compile_definitions(FALLBACK_RUNTIME_PREFIX="${FALLBACK_RUNTIME_PREFIX}"
ETC_GITATTRIBUTES="../etc/gitattributes"
ETC_GITCONFIG="../etc/gitconfig")
else()
set(FALLBACK_RUNTIME_PREFIX /home/$ENV{USER})
add_compile_definitions(FALLBACK_RUNTIME_PREFIX="${FALLBACK_RUNTIME_PREFIX}")
add_compile_definitions(FALLBACK_RUNTIME_PREFIX="${FALLBACK_RUNTIME_PREFIX}"
ETC_GITATTRIBUTES="etc/gitattributes"
ETC_GITCONFIG="etc/gitconfig")
endif()


Expand Down