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

Conversation

dscho
Copy link
Member

@dscho dscho commented Jun 22, 2021

Implementation details let Git for Windows' git.exe live in /mingw64/bin (that is the pseudo-Unix path, of course, the real Windows path will be prefixed by the actual installation location). This resulted in the awkward location of the system config in C:\Program Files\Git\mingw64\etc\gitconfig, and that is what Git for Windows v2.x used for a few years.

A much more natural location, however, is the same path without that mingw64 infix. Therefore, the Git for Windows project switched (back) to that location for a while now.

It is time to bring that change into core Git.

dscho and others added 3 commits June 22, 2021 11:43
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 <johannes.schindelin@gmx.de>
Currently, when Git for Windows is built with CMake, the system Git config is
expected in a different location than when building via `make`: the former
expects it to be in `<runtime-prefix>/mingw64/etc/gitconfig`, the latter in
`<runtime-prefix>/etc/gitconfig`.

Because of this, things like `git clone` do not work correctly (because cURL is
no longer able to find its certificate bundle that it needs to validate HTTPS
certificates). See the full bug report and discussion here:
git-for-windows#3071 (comment).

This commit aligns the CMake-based build by mimicking what is already done in
`config.mak.uname`.

This closes git-for-windows#3071.

Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
Git for Windows is compiled with a runtime prefix, and that runtime
prefix is typically `C:/Program Files/Git/mingw64`. As we want the
system gitconfig to live in the sibling directory `etc`, we define the
relative path as `../etc/gitconfig`.

However, as reported by Philip Oakley, the output of `git config
--show-origin --system -l` looks rather ugly, as it shows the path as
`file:C:/Program Files/Git/mingw64/../etc/gitconfig`, i.e. with the
`mingw64/../` part.

By normalizing the path, we get a prettier path.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Member Author

dscho commented Jun 22, 2021

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Jun 22, 2021

Submitted as pull.984.git.1624358809.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git pr-984/dscho/move-gfw-system-config-to-top-level-v1

To fetch this version to local tag pr-984/dscho/move-gfw-system-config-to-top-level-v1:

git fetch --no-tags https://github.com/gitgitgadget/git tag pr-984/dscho/move-gfw-system-config-to-top-level-v1

@gitgitgadget
Copy link

gitgitgadget bot commented Jun 29, 2021

This branch is now known as js/gfw-system-config-loc-fix.

@gitgitgadget
Copy link

gitgitgadget bot commented Jun 29, 2021

This patch series was integrated into seen via git@2da608b.

@gitgitgadget gitgitgadget bot added the seen label Jun 29, 2021
@gitgitgadget
Copy link

gitgitgadget bot commented Jun 29, 2021

This patch series was integrated into seen via git@df951d9.

@gitgitgadget
Copy link

gitgitgadget bot commented Jun 30, 2021

This patch series was integrated into seen via git@8c6f71a.

@gitgitgadget
Copy link

gitgitgadget bot commented Jun 30, 2021

The branch js/gfw-system-config-loc-fix was mentioned in the "New Topics" section of the status updates on the Git mailing list.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 1, 2021

This patch series was integrated into seen via git@cb3b2d7.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 1, 2021

This patch series was integrated into seen via git@39a246c.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 2, 2021

This patch series was integrated into seen via git@459769f.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 6, 2021

This patch series was integrated into seen via git@804e40a.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 7, 2021

There was a status update in the "Cooking" section about the branch js/gfw-system-config-loc-fix on the Git mailing list:

Update the location of system-side configuration file on Windows.

Will merge to 'next'.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 7, 2021

This patch series was integrated into seen via git@1b824e5.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 8, 2021

This patch series was integrated into seen via git@56256c1.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 8, 2021

This patch series was integrated into next via git@91a090a.

@gitgitgadget gitgitgadget bot added the next label Jul 8, 2021
@gitgitgadget
Copy link

gitgitgadget bot commented Jul 8, 2021

There was a status update in the "Cooking" section about the branch js/gfw-system-config-loc-fix on the Git mailing list:

Update the location of system-side configuration file on Windows.

Will merge to 'master'.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 14, 2021

This patch series was integrated into seen via git@aa072c6.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 14, 2021

There was a status update in the "Cooking" section about the branch js/gfw-system-config-loc-fix on the Git mailing list:

Update the location of system-side configuration file on Windows.

Will merge to 'master'.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 19, 2021

This patch series was integrated into seen via git@bc34e52.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 19, 2021

This patch series was integrated into next via git@bc34e52.

@gitgitgadget
Copy link

gitgitgadget bot commented Jul 19, 2021

This patch series was integrated into master via git@bc34e52.

@gitgitgadget gitgitgadget bot added the master label Jul 19, 2021
@gitgitgadget gitgitgadget bot closed this Jul 19, 2021
@gitgitgadget
Copy link

gitgitgadget bot commented Jul 19, 2021

Closed via bc34e52.

@dscho dscho deleted the move-gfw-system-config-to-top-level branch July 19, 2021 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants