summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorLibravatar Jonathan Nieder <jrnieder@gmail.com>2010-11-26 22:32:31 +0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-11-29 13:26:00 -0800
commit80d868b068b9e68a4aac91be578a8f097f45d8da (patch)
treefeb72f87fc07b5e62edefd48efb405654a2980ef /Documentation
parentt1510: setup case #31 (diff)
downloadtgif-80d868b068b9e68a4aac91be578a8f097f45d8da.tar.xz
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>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/git-rev-parse.txt7
1 files changed, 6 insertions, 1 deletions
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