threads / patch / 17834

patchMinor grammar fix in the 'Not a git repository' message

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

## tl;dr

8 messages between Feb 16, 2009 and Feb 17, 2009. Diffs are folded; open one to read it.

replies: 7people: 7as markdown or json

Johannes Schindelin· Feb 16, 2009, 22:58 UTC · lore

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(-)
Show changes to setup.c +1 −1
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· Feb 16, 2009, 23:27 UTC · re: Johannes Schindelin · lore

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

El 16/2/2009, a las 23:58, Johannes Schindelin escribió:
Show 8 quoted lines
> 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· Feb 16, 2009, 23:33 UTC · re: Johannes Schindelin · lore

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

Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 8 quoted lines
> 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· Feb 17, 2009, 00:17 UTC · re: Junio C Hamano · lore

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

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· Feb 17, 2009, 00:51 UTC · re: Nicolas Sebrecht · lore

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

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.· Feb 17, 2009, 03:16 UTC · re: Junio C Hamano · lore

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

On Monday 16 February 2009 18:51:03 Junio C Hamano wrote:
Show 8 quoted lines
> 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/                    \_/
Jakub Narebski· Feb 17, 2009, 09:29 UTC · re: Boyd Stephen Smith Jr. · lore

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

"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:
Show 10 quoted lines
> > > 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
Lars Noschinski· Feb 17, 2009, 08:50 UTC · re: Junio C Hamano · lore

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

* Junio C Hamano <gitster@pobox.com> [09-02-17 01:51]:
Show 12 quoted lines
>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.

← back to recent threads