Re: What's cooking in git.git (Apr 2021, #04; Thu, 15)

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

 



Hi Peff,

On Thu, 15 Apr 2021, Jeff King wrote:

> On Thu, Apr 15, 2021 at 05:04:37PM -0700, Junio C Hamano wrote:
>
> > * ps/config-global-override (2021-04-13) 3 commits
> >   (merged to 'next' on 2021-04-15 at 60a58d74ab)
> >  + config: allow overriding of global and system configuration
> >  + config: unify code paths to get global config paths
> >  + config: rename `git_etc_config()`
> >
> >  Replace GIT_CONFIG_NOSYSTEM mechanism to decline from reading the
> >  system-wide configuration file with GIT_CONFIG_SYSTEM that lets
> >  users specify from which file to read the system-wide configuration
> >  (setting it to an empty file would essentially be the same as
> >  setting NOSYSTEM), and introduce GIT_CONFIG_GLOBAL to override the
> >  per-user configuration in $HOME/.gitconfig.
> >
> >  Will merge to 'master'.
>
> Looks like this fails CI on the Windows VS build. I get:
>
>   ++ env GIT_CONFIG_GLOBAL=does-not-exist GIT_CONFIG_SYSTEM=/dev/null git config --global --list
>   fatal: unable to access 'nul': Invalid argument
>
> from t1300.181. I thought we had some magic to make /dev/null work there
> (or maybe this _is_ the magic kicking in, since it is looking for the
> Windows-ish nul, but it is not working for some reason).

Seems that this fixes it for me:

-- snipsnap --
>From 754593d6bda3754ab4afaa98b814351e922a1fe3 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@xxxxxx>
Date: Fri, 16 Apr 2021 13:11:05 +0200
Subject: [PATCH] msvc: avoid calling `access("NUL", flags)`

Apparently this is not supported with Microsoft's Universal C Runtime.
So let's not actually do that.

Instead, just return success because we _know_ that we expect the `NUL`
device to be present.

Side note: it is possible to turn off the "Null device driver" and
thereby disable `NUL`. Too many things are broken if this driver is
disabled, therefore it is not worth bothering to try to detect its
presence when `access()` is called.

Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx>
---
 compat/mingw.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/compat/mingw.c b/compat/mingw.c
index a43599841c6c..aa647b367b0f 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -685,6 +685,8 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
 int mingw_access(const char *filename, int mode)
 {
 	wchar_t wfilename[MAX_PATH];
+	if (!strcmp("nul", filename) || !strcmp("/dev/null", filename))
+		return 0;
 	if (xutftowcs_path(wfilename, filename) < 0)
 		return -1;
 	/* X_OK is not supported by the MSVCRT version */
--
2.31.1.windows.1





[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