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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:46:13

Johannes Schindelin [off-list ref] 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.

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

From: Nicolas Sebrecht <hidden>
Date: 2016-06-15 22:46:13

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help