From: Nguyễn Thái Ngọc Duy Date: Mon, 01 Nov 2010 06:26:26 GMT Subject: [PATCH 1/9] git-rev-parse.txt: clarify --git-dir Message-ID: <1288592794-24221-1-git-send-email-pclouds@gmail.com> In-Reply-To: From: Jonathan Nieder 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 Signed-off-by: Nguyễn Thái Ngọc Duy --- 2010/10/30 Sverre Rabbelier : > Heya, > > 2010/10/28 Nguyễn Thái Ngọc Duy : >> 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