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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jonathan Nieder <jrnieder@xxxxxxxxx>

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@xxxxxxxxx>
Signed-off-by: Nguyán ThÃi Ngác Duy <pclouds@xxxxxxxxx>
---
 2010/10/30 Sverre Rabbelier <srabbelier@xxxxxxxxx>:
 > Heya,
 >
 > 2010/10/28 Nguyán ThÃi Ngác Duy <pclouds@xxxxxxxxx>:
 >> 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]