Re: [git-for-windows] Git for Windows v2.24.0-rc0, was Re: [ANNOUNCE] Git v2.24.0-rc0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Philip,

On Tue, 22 Oct 2019, Philip Oakley wrote:

> The minor pedant did notice that the new location is listed slightly
> differently from the release notes.
> `file:C:/Program Files/Git/mingw64/../etc/gitconfig`  --system,
> while the release notes simplify the path to C:/Program
> Files/Git/etc/gitconfig

That's a good point. I guess that it would make sense to normalize the
location of the system gitconfig:

-- snip --
Subject: [PATCH] config: normalize the path of the system gitconfig

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@xxxxxx>
---
 config.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/config.c b/config.c
index e7052b39773..8e2f4748c49 100644
--- a/config.c
+++ b/config.c
@@ -1658,8 +1658,10 @@ static int git_config_from_blob_ref(config_fn_t fn,
 const char *git_etc_gitconfig(void)
 {
 	static const char *system_wide;
-	if (!system_wide)
+	if (!system_wide) {
 		system_wide = system_path(ETC_GITCONFIG);
+		normalize_path_copy((char *)system_wide, system_wide);
+	}
 	return system_wide;
 }

--
2.24.0.rc1.windows.1
-- snap --

See also https://github.com/git-for-windows/git/pull/2370

Ciao,
Dscho

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux