From: Jonathan Nieder Date: Fri, 26 Nov 2010 15:32:31 +0000 (+0700) Subject: git-rev-parse.txt: clarify --git-dir X-Git-Tag: v1.7.4-rc0~4^2~12 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=80d868b068b9e68a4aac91be578a8f097f45d8da;p=git.git git-rev-parse.txt: clarify --git-dir The current behavior is often to print an absolute path rather than a ../../etc string, but callers must be ready to accept a relative path, too. The most common output is ".git" (from the toplevel of an ordinary work tree). Signed-off-by: Jonathan Nieder Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt index 4a27643c1..ff23cb021 100644 --- a/Documentation/git-rev-parse.txt +++ b/Documentation/git-rev-parse.txt @@ -136,7 +136,12 @@ appending `/{asterisk}`. directory (typically a sequence of "../", or an empty string). --git-dir:: - Show `$GIT_DIR` if defined else show the path to the .git directory. + Show `$GIT_DIR` if defined. Otherwise show the path to + the .git directory, relative to the current directory. ++ +If `$GIT_DIR` is not defined and the current directory +is not detected to lie in a git repository or work tree +print a message to stderr and exit with nonzero status. --is-inside-git-dir:: When the current working directory is below the repository