# [MinGW PATCH] Fixed error 'fatal: Not a git repository' on Vista

4 messages from 2007-08-02 to 2007-08-16. Participants: Dmitry Kakurin, Johannes Schindelin, Johannes Sixt, Marco Roeland.
Thread: https://gitlist.dev/t/9348

## Dmitry Kakurin, 2007-08-02 05:47

Subject: [MinGW PATCH] Fixed error 'fatal: Not a git repository' on Vista
Message-ID: <DE6EEF3D318C4051827B95DF26D97BE7@ntdev.corp.microsoft.com>
URL: https://gitlist.dev/e/DE6EEF3D318C4051827B95DF26D97BE7%40ntdev.corp.microsoft.com

```
Any git command was immediately failing on Vista under MinGW with
fatal: Not a git repository

>From 51d66fbfe3a7876d9a7b699bb47c0ab186ddc7a2 Mon Sep 17 00:00:00 2001
From: Dmitry Kakurin <Dmitry.Kakurin@gmail.com>
Date: Wed, 1 Aug 2007 22:30:43 -0700
Subject: [PATCH] Fixed error 'fatal: Not a git repository' on Vista
Defined __USE_MINGW_ACCESS that changes access( ..., X_OK ) into F_OK

Signed-off-by: Dmitry Kakurin <Dmitry.Kakurin@gmail.com>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 8e9a76b..ef40267 100644
--- a/Makefile
+++ b/Makefile
@@ -500,7 +500,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
  NO_SYMLINKS=YesPlease
  NO_SVN_TESTS=YesPlease
  NO_PERL_MAKEMAKER=YesPlease
- COMPAT_CFLAGS 
+= -DNO_ETC_PASSWD -DNO_ST_BLOCKS -DSTRIP_EXTENSION=\".exe\" -I compat
+ COMPAT_CFLAGS 
+= -DNO_ETC_PASSWD -DNO_ST_BLOCKS -DSTRIP_EXTENSION=\".exe\" -D__USE_MINGW_ACCESS 
 -I compat
  COMPAT_OBJS += compat/mingw.o compat/fnmatch.o compat/regex.o
  EXTLIBS += -lws2_32
  X = .exe
-- 
1.5.2.2

```

## Johannes Schindelin, 2007-08-02 10:33

Subject: Re: [MinGW PATCH] Fixed error 'fatal: Not a git repository' on Vista
Message-ID: <Pine.LNX.4.64.0708021107470.14781@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0708021107470.14781%40racer.site
In-Reply-To: <DE6EEF3D318C4051827B95DF26D97BE7@ntdev.corp.microsoft.com>

```
Hi,

[please consider reading Documentation/SubmittingPatches; you did not Cc: 
the maintainer, Johannes Sixt]

On Wed, 1 Aug 2007, Dmitry Kakurin wrote:

> Any git command was immediately failing on Vista under MinGW with
> fatal: Not a git repository

Thanks for submitting this patch.  I cannot test personally, because 
nobody I know has Vista.

I guess that Hannes will apply your patch when he comes back from his 
well-deserved holiday.

You might want to consider pushing your changes to the mob branch on 
repo.or.cz/git/mingw.git.

>From your mail, I take it that the .zip file I sent you is working 
properly?

Ciao,
Dscho

```

## Johannes Sixt, 2007-08-16 08:37

Subject: Re: [MinGW PATCH] Fixed error 'fatal: Not a git repository' on Vista
Message-ID: <46C40CB3.5415D888@eudaptics.com>
URL: https://gitlist.dev/e/46C40CB3.5415D888%40eudaptics.com
In-Reply-To: <DE6EEF3D318C4051827B95DF26D97BE7@ntdev.corp.microsoft.com>

```
Dmitry Kakurin wrote:
> - COMPAT_CFLAGS
> += -DNO_ETC_PASSWD -DNO_ST_BLOCKS -DSTRIP_EXTENSION=\".exe\" -I compat
> + COMPAT_CFLAGS
> += -DNO_ETC_PASSWD -DNO_ST_BLOCKS -DSTRIP_EXTENSION=\".exe\" -D__USE_MINGW_ACCESS

I don't see how this could make a difference: __USE_MINGW_ACCESS appears
in none of the mingw header files nor in the mingw.git sources.

Is my build environment outdated?

-- Hannes

```

## Marco Roeland, 2007-08-16 09:56

Subject: Re: [MinGW PATCH] Fixed error 'fatal: Not a git repository' on Vista
Message-ID: <20070816095655.GA13069@fiberbit.xs4all.nl>
URL: https://gitlist.dev/e/20070816095655.GA13069%40fiberbit.xs4all.nl
In-Reply-To: <46C40CB3.5415D888@eudaptics.com>

```
On Thursday August 16th 2007 at 10:37 Johannes Sixt wrote:

> I don't see how this could make a difference: __USE_MINGW_ACCESS appears
> in none of the mingw header files nor in the mingw.git sources.
> 
> Is my build environment outdated?

The mingw patch for fixing this Vista regression (from Danny Smith on
March 5th) is in mingw-runtime-3.12-1. It is in file <include/io.h> and
works like this:

#ifdef __USE_MINGW_ACCESS
/*  Old versions of MSVCRT access() just ignored X_OK, while the version
    shipped with Vista, returns an error code.  This will restore the
    old behaviour  */
static inline int __mingw_access (const char* __fname, int __mode)
  { return  _access (__fname, __mode & ~X_OK); }
#define access(__f,__m)  __mingw_access (__f, __m)
#endif

Whenever the X_OK bit is set in the mode flag for access(2) Vista
returns an error for the call. So yes, using __USE_MINGW_ACCESS will not
work on older mingw versions. Defining X_OK to 0 for mingw might fix the
problem for older versions.
-- 
Marco Roeland

```
