Skip to content

Commit

Permalink
git-rev-parse.txt: clarify --git-dir
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonathan Nieder authored and Junio C Hamano committed Nov 29, 2010
1 parent e0d769d commit 80d868b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Documentation/git-rev-parse.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 80d868b

Please sign in to comment.