[PATCH 35/47] git-rev-parse.txt: clarify --git-dir
- From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
- Date
- Nov 26, 2010, 15:32 UTC
- Message-ID
- <1290785563-15339-36-git-send-email-pclouds@gmail.com>
- In-Reply-To
- <1290785563-15339-1-git-send-email-pclouds@gmail.com>
From: Jonathan Nieder <jrnieder@gmail.com>
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> --- Documentation/git-rev-parse.txt | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt index 4a27643..ff23cb0 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
-- 1.7.3.2.316.gda8b3