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 <jrnieder@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder committed
Nov 26, 2010 at 22:32 UTC
80d868b068b9e68a4aac91be578a8f097f45d8da
1 file changed
+6
-1
Documentation/git-rev-parse.txt
+6
-1
@@ -136,7 +136,12 @@ appending `/{asterisk}`.
136
directory (typically a sequence of "../", or an empty string).
137
138
--git-dir::
139
- Show `$GIT_DIR` if defined else show the path to the .git directory.
139
+ Show `$GIT_DIR` if defined. Otherwise show the path to
140
+ the .git directory, relative to the current directory.
141
++
142
+If `$GIT_DIR` is not defined and the current directory
143
+is not detected to lie in a git repository or work tree
144
+print a message to stderr and exit with nonzero status.
145
146
--is-inside-git-dir::
147
When the current working directory is below the repository