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.