git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] Documentation/githooks: mention pwd, $GIT_PREFIX

From
RHRichard Hansen <rhansen@bbn.com>
Date
Jan 10, 2015, 06:49 UTC
Message-ID
<1420872598-9609-2-git-send-email-rhansen@bbn.com>
In-Reply-To
<1420872598-9609-1-git-send-email-rhansen@bbn.com>

Document that hooks are run from the top-level directory and that GIT_PREFIX is set to the name of the original subdirectory (relative to the top-level directory).

Signed-off-by: Richard Hansen <rhansen@bbn.com>
---
 Documentation/githooks.txt | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
index 9ef2469..c08f4fd 100644
--- a/Documentation/githooks.txt
+++ b/Documentation/githooks.txt
@@ -26,6 +26,12 @@ executable by default.
 
 This document describes the currently defined hooks.
 
+Hooks are executed from the top-level directory of a repository, which
+may not necessarily be the current directory.
+The 'GIT_PREFIX' environment variable is set as returned by running
+'git rev-parse --show-prefix' from the original current directory.
+See linkgit:git-rev-parse[1].
+
 HOOKS
 -----
 
-- 
2.2.1
Previous: Richard HansenNext: Richard Hansen
Message 2 of 9 in “Documentation/githooks: mention pwd, $GIT_PREFIX”
  1. 0/2 Documentation/githooks: mention pwd, $GIT_PREFIXRichard Hansen, Jan 10, 2015
  2. 1/2 Documentation/githooks: mention pwd, $GIT_PREFIXRichard Hansen, Jan 10, 2015
  3. 2/2 t1020-subdirectory.sh: check hook pwd, $GIT_PREFIXRichard Hansen, Jan 10, 2015
  4. Johannes SixtJan 10, 2015
  5. 0/2 Documentation/githooks: mention pwd, $GIT_PREFIXRichard Hansen, Jan 10, 2015
  6. 1/2 Documentation/githooks: mention pwd, $GIT_PREFIXRichard Hansen, Jan 10, 2015
  7. Junio C HamanoJan 12, 2015
  8. 2/2 t1020-subdirectory.sh: check hook pwd, $GIT_PREFIXRichard Hansen, Jan 10, 2015
  9. Junio C HamanoJan 12, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.