# [PATCH] Minor grammar fix in the 'Not a git repository' message

8 messages from 2009-02-16 to 2009-02-17. Participants: Johannes Schindelin, Wincent Colaiuta, Junio C Hamano, Nicolas Sebrecht, Boyd Stephen Smith Jr., Lars Noschinski, Jakub Narebski.
Thread: https://gitlist.dev/t/17834

## Johannes Schindelin, 2009-02-16 22:58

Subject: [PATCH] Minor grammar fix in the 'Not a git repository' message
Message-ID: <8787c5894e7831bbd1ace3b2fd6649f1362d4b78.1234825069u.git.johannes.schindelin@gmx.de>
URL: https://gitlist.dev/e/8787c5894e7831bbd1ace3b2fd6649f1362d4b78.1234825069u.git.johannes.schindelin%40gmx.de
In-Reply-To: <cover.1234825069u.git.johannes.schindelin@gmx.de>

```
It might cause less head-scratching to say 'nor any of the parent
directories' than 'or ...' after saying that this is not a git
repository.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/setup.c b/setup.c
index 6c2deda..05bd462 100644
--- a/setup.c
+++ b/setup.c
@@ -386,7 +386,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
 				*nongit_ok = 1;
 				return NULL;
 			}
-			die("Not a git repository (or any of the parent directories): %s", DEFAULT_GIT_DIR_ENVIRONMENT);
+			die("Not a git repository (nor any of the parent directories): %s", DEFAULT_GIT_DIR_ENVIRONMENT);
 		}
 		if (chdir(".."))
 			die("Cannot change to %s/..: %s", cwd, strerror(errno));
-- 
1.6.2.rc0.397.g19ae22

```

## Wincent Colaiuta, 2009-02-16 23:27

Subject: Re: [PATCH] Minor grammar fix in the 'Not a git repository' message
Message-ID: <E8469C6E-A238-4DD0-B287-09E8ABCE4801@wincent.com>
URL: https://gitlist.dev/e/E8469C6E-A238-4DD0-B287-09E8ABCE4801%40wincent.com
In-Reply-To: <8787c5894e7831bbd1ace3b2fd6649f1362d4b78.1234825069u.git.johannes.schindelin@gmx.de>

```
El 16/2/2009, a las 23:58, Johannes Schindelin escribió:

> It might cause less head-scratching to say 'nor any of the parent
> directories' than 'or ...' after saying that this is not a git
> repository.
>
> -			die("Not a git repository (or any of the parent directories):  
> %s", DEFAULT_GIT_DIR_ENVIRONMENT);
> +			die("Not a git repository (nor any of the parent directories):  
> %s", DEFAULT_GIT_DIR_ENVIRONMENT);

Or could just avoid the whole "or/nor" construct entirely by just  
saying?

   "Not inside a git repository"

```

## Junio C Hamano, 2009-02-16 23:33

Subject: Re: [PATCH] Minor grammar fix in the 'Not a git repository' message
Message-ID: <7vd4diez2z.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vd4diez2z.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <8787c5894e7831bbd1ace3b2fd6649f1362d4b78.1234825069u.git.johannes.schindelin@gmx.de>

```
Johannes Schindelin <johannes.schindelin@gmx.de> writes:

> It might cause less head-scratching to say 'nor any of the parent
> directories' than 'or ...' after saying that this is not a git
> repository.
> ...
> +			die("Not a git repository (nor any of the parent directories): %s", DEFAULT_GIT_DIR_ENVIRONMENT);
>  		}
>  		if (chdir(".."))
>  			die("Cannot change to %s/..: %s", cwd, strerror(errno));

The grammar may be more correct, but I wonder if the parenthesised part is
adding any value to the message or instead it is making the message more
confusing.

You will get this message when you are in /a/b/c/d and no .git
subdirectory was found in /a/b/c/d, nor in /a/b/c, nor in /a/b,...

But the message sounds as if the command expected ".git" to be either (1)
a git repository (which is false, because ".git" would mean /a/b/c/d/.git
and there is no git repository there), or (2) a parent directory (of
something unspecified, but a natural interpretation is "where you are"),
i.e. "I wanted you to be somewhere inside .git".  That obviously is not
what you wanted to say.

    "No git repository ".git" found here nor in any of the parent directories"

might be an improvement, though.

```

## Nicolas Sebrecht, 2009-02-17 00:17

Subject: [PATCH] Re: Minor grammar fix in the 'Not a git repository' message
Message-ID: <20090217001747.GA23278@vidovic>
URL: https://gitlist.dev/e/20090217001747.GA23278%40vidovic
In-Reply-To: <7vd4diez2z.fsf@gitster.siamese.dyndns.org>

```

On Mon, Feb 16, 2009 at 03:33:56PM -0800, Junio C Hamano wrote:

>     "No git repository ".git" found here nor in any of the parent directories"

What about bare repositories ? 

The message
	"Not inside a git repository" 
of Wincent looks like the clearest and the fairest one.

-- 
Nicolas Sebrecht

```

## Junio C Hamano, 2009-02-17 00:51

Subject: Re: [PATCH] Re: Minor grammar fix in the 'Not a git repository' message
Message-ID: <7vk57pevig.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vk57pevig.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20090217001747.GA23278@vidovic>

```
Nicolas Sebrecht <nicolas.s-dev@laposte.net> writes:

> The message
> 	"Not inside a git repository" 
> of Wincent looks like the clearest and the fairest one.

I tend to agree.  I was only trying to see if we can salvage a more
precise diagnosis f66bc5f (Always show which directory is not a git
repository, 2008-12-22) tried to give users, but to do it throughly the
sentence will become even more awkward.

    "Not inside a bare git repository nor a work tree that has .git/ somewhere in it."

```

## Boyd Stephen Smith Jr., 2009-02-17 03:16

Subject: Re: [PATCH] Re: Minor grammar fix in the 'Not a git repository' message
Message-ID: <200902162116.55484.bss@iguanasuicide.net>
URL: https://gitlist.dev/e/200902162116.55484.bss%40iguanasuicide.net
In-Reply-To: <7vk57pevig.fsf@gitster.siamese.dyndns.org>

```
On Monday 16 February 2009 18:51:03 Junio C Hamano wrote:
> Nicolas Sebrecht <nicolas.s-dev@laposte.net> writes:
> > The message
> > 	"Not inside a git repository"
> > of Wincent looks like the clearest and the fairest one.
>
> I tend to agree.  I was only trying to see if we can salvage a more
> precise diagnosis f66bc5f (Always show which directory is not a git
> repository, 2008-12-22) tried to give users.

"Not in a git repository or work tree: %s", DEFAULT_GIT_DIR_ENVIRONMENT
?
-- 
Boyd Stephen Smith Jr.                   ,= ,-_-. =.
bss@iguanasuicide.net                   ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy         `-'(. .)`-'
http://iguanasuicide.net/                    \_/


```

## Lars Noschinski, 2009-02-17 08:50

Subject: Re: [PATCH] Re: Minor grammar fix in the 'Not a git repository' message
Message-ID: <20090217085028.GB7338@lars.home.noschinski.de>
URL: https://gitlist.dev/e/20090217085028.GB7338%40lars.home.noschinski.de
In-Reply-To: <7vk57pevig.fsf@gitster.siamese.dyndns.org>

```
* Junio C Hamano <gitster@pobox.com> [09-02-17 01:51]:
>Nicolas Sebrecht <nicolas.s-dev@laposte.net> writes:
>
>> The message
>> 	"Not inside a git repository" 
>> of Wincent looks like the clearest and the fairest one.
>
>I tend to agree.  I was only trying to see if we can salvage a more
>precise diagnosis f66bc5f (Always show which directory is not a git
>repository, 2008-12-22) tried to give users, but to do it throughly the
>sentence will become even more awkward.
>
>    "Not inside a bare git repository nor a work tree that has .git/ somewhere in it."

I think f66bc5f used the wrong path for the error message.
If the comment above this part of the code is accurate, cwd
is which should be belonging to a git repository, so I would suggest

     die("Not inside a git repository: %s", cwd)

  - Lars.

```

## Jakub Narebski, 2009-02-17 09:29

Subject: Re: [PATCH] Re: Minor grammar fix in the 'Not a git repository' message
Message-ID: <m31vtxtntf.fsf@localhost.localdomain>
URL: https://gitlist.dev/e/m31vtxtntf.fsf%40localhost.localdomain
In-Reply-To: <200902162116.55484.bss@iguanasuicide.net>

```
"Boyd Stephen Smith Jr." <bss@iguanasuicide.net> writes:
> On Monday 16 February 2009 18:51:03 Junio C Hamano wrote:
> > Nicolas Sebrecht <nicolas.s-dev@laposte.net> writes:

> > > The message
> > > 	"Not inside a git repository"
> > > of Wincent looks like the clearest and the fairest one.
> >
> > I tend to agree.  I was only trying to see if we can salvage a more
> > precise diagnosis f66bc5f (Always show which directory is not a git
> > repository, 2008-12-22) tried to give users.
> 
> "Not in a git repository or work tree: %s", DEFAULT_GIT_DIR_ENVIRONMENT
> ?

"Not in a git repository or in a work tree: %s" perhaps...
cwd or DEFAULT_GIT_DIR_ENVIRONMENT?

-- 
Jakub Narebski
Poland
ShadeHawk on #git

```
