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.5.4~1^2~5 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/80d868b068b9e68a4aac91be578a8f097f45d8da?hp=e0d769d1fda4f66a1c0b99f3f52a25d4f4006162 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 4a27643c1e..ff23cb0219 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