Subject: [PATCH 1/9] git-rev-parse.txt: clarify --git-dir

From: Nguyễn Thái Ngọc Duy <[email-masked]>
Date: Mon, 1 Nov 2010 13:26:26 +0700

From: Jonathan Nieder <[email-masked]>

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 <[email-masked]>
Signed-off-by: Nguyễn Thái Ngọc Duy <[email-masked]>
---
 2010/10/30 Sverre Rabbelier <[email-masked]>:
 > Heya,
 >
 > 2010/10/28 Nguyễn Thái Ngọc Duy <[email-masked]>:
 >> This helps break things some more. Eventually all repo setup logic
 >> should be centralized in setup_* functions. This helps push all the
 >> bugs back to setup_* functions.
 >
 > I don't know about this, do we really want to willingly break the test
 > suite (and fixing it later)? Perhaps we can review this as-is and then
 > squash the commits before they are merged to next so that there is no
 > breakage? We could even attach the original commits as notes :).

 OK. Take 2. I think it is bisectable this time. This replaces
 35-42 (the fixing part, no need to resend 34 unchanged patches). More notes
 on each patch.

 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 341ca90..a41f024 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.210.g045198