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>
This commit is contained in:
Jonathan Nieder 2010-11-26 22:32:31 +07:00 committed by Junio C Hamano
parent e0d769d1fd
commit 80d868b068

View File

@ -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