From 3444a70aed0e4a9984776bfbba1dc87752de2931 Mon Sep 17 00:00:00 2001 From: Andreas Heiduk Date: Mon, 15 May 2017 22:26:32 +0200 Subject: [PATCH 1/2] Remove support for XP specific config location Current Git for Windows supports an additional configuration location for system setting. On contemporary versionws of Windows this is $PROGRAMDATA/Git/config. But XP does not know about $PRORGRAMDATA so $ALLUSERSPROFILE/Application Data/Git/config was used. XP itself is EOL for quite some time and Git for Windows ceased to support it officially with version 2.10.0 (release 3 Sep 2016). https://github.com/git-for-windows/git/wiki/FAQ#which-versions-of-windows-are-supported https://git-for-windows.github.io/requirements.html Signed-off-by: Andreas Heiduk --- Documentation/git-config.txt | 3 +-- compat/mingw.c | 7 +------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt index 273b6d01865df5..99be0e9ca0ce4c 100644 --- a/Documentation/git-config.txt +++ b/Documentation/git-config.txt @@ -258,8 +258,7 @@ config file (located at `$PROGRAMDATA/Git/config`), intended to contain settings for *all* Git-related software running on the machine. Consequently, this config file takes an even lower precedence than the `$(prefix)/etc/gitconfig` file. Typically `$PROGRAMDATA` points to -`C:\ProgramData` (on Windows XP the equivalent in `$ALLUSERSPROFILE` is used, -i.e. `C:\Documents and Settings\All Users\Application Data\Git\config`). +`C:\ProgramData`. If no further options are given, all reading options will read all of these files that are available. If the global or the system-wide configuration diff --git a/compat/mingw.c b/compat/mingw.c index 4c48e656871cf9..1c5acb6f937cb2 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -3273,13 +3273,8 @@ const char *program_data_config(void) if (!initialized) { const char *env = mingw_getenv("PROGRAMDATA"); - const char *extra = ""; - if (!env) { - env = mingw_getenv("ALLUSERSPROFILE"); - extra = "/Application Data"; - } if (env) - strbuf_addf(&path, "%s%s/Git/config", env, extra); + strbuf_addf(&path, "%s/Git/config", env); initialized = 1; } return *path.buf ? path.buf : NULL; From ab2fbf573b550b4bbb319c7f94af366ce800500b Mon Sep 17 00:00:00 2001 From: Andreas Heiduk Date: Mon, 15 May 2017 23:39:51 +0200 Subject: [PATCH 2/2] Improve documentation for C:\ProgramData\Git\config Move the description for the additional Git for Windows configuration file into the right place, so that the following descriptions of the read priority also covers this file correctly. Also make it clear, what file `git config --system` selects. Signed-off-by: Andreas Heiduk --- Documentation/git-config.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt index 99be0e9ca0ce4c..1b8679cff560b8 100644 --- a/Documentation/git-config.txt +++ b/Documentation/git-config.txt @@ -235,8 +235,16 @@ FILES If not set explicitly with `--file`, there are four files where 'git config' will search for configuration options: +$PROGRAMDATA/Git/config:: + (Windows-only) System-wide configuration file shared with other Git + implementations. Typically `$PROGRAMDATA` points to `C:\ProgramData`. + $(prefix)/etc/gitconfig:: System-wide configuration file. + (Windows-only) This file contains only the settings which are + specific for this installation of Git for Windows and which should + not be shared with other Git implementations like JGit, libgit2. + `--system` will select this file. $XDG_CONFIG_HOME/git/config:: Second user-specific configuration file. If $XDG_CONFIG_HOME is not set @@ -253,13 +261,6 @@ $XDG_CONFIG_HOME/git/config:: $GIT_DIR/config:: Repository specific configuration file. -On Windows, as there is no central `/etc/` directory, there is yet another -config file (located at `$PROGRAMDATA/Git/config`), intended to contain -settings for *all* Git-related software running on the machine. Consequently, -this config file takes an even lower precedence than the -`$(prefix)/etc/gitconfig` file. Typically `$PROGRAMDATA` points to -`C:\ProgramData`. - If no further options are given, all reading options will read all of these files that are available. If the global or the system-wide configuration file are not available they will be ignored. If the repository configuration