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:
parent
e0d769d1fd
commit
80d868b068
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user