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

[PATCH] Documentation for post-checkout and post-merge hooks

From
JEJosh England <jjengla@sandia.gov>
Date
Sep 25, 2007, 22:49 UTC
Message-ID
<1190760563-32453-3-git-send-email-jjengla@sandia.gov>
In-Reply-To
<1190760563-32453-2-git-send-email-jjengla@sandia.gov>
Signed-off-by: Josh England <jjengla@sandia.gov>
---
 Documentation/hooks.txt |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/Documentation/hooks.txt b/Documentation/hooks.txt
index c39edc5..37a3e5a 100644
--- a/Documentation/hooks.txt
+++ b/Documentation/hooks.txt
@@ -87,6 +87,31 @@ parameter, and is invoked after a commit is made.
 This hook is meant primarily for notification, and cannot affect
 the outcome of `git-commit`.
 
+post-checkout
+-----------
+
+This hook is invoked when a `git-checkout` is run after having updated the
+worktree.  The hook is given two parameters: the ref of the previous HEAD and
+the ref of the new HEAD, which may or may not have changed.  This hook cannot
+affect the outcome of `git-checkout`.
+
+This hook can be used to perform repository validity checks, auto-display
+differences from the previous HEAD if different, or set working dir metadata
+properties.
+
+post-merge
+-----------
+
+This hook is invoked by `git-merge`, which happens when a `git pull`
+is done on a local repository.  The hook takes a single parameter, a status
+flag specifying whether or not the merge being done was a squash merge.
+This hook cannot affect the outcome of `git-merge`.
+
+This hook can be used in conjunction with a corresponding pre-commit hook to
+save and restore any form of metadata associated with the working tree
+(eg: permissions/ownership, ACLS, etc).  See contrib/hooks/setgitperms.pl
+for an example of how to do this.
+
 [[pre-receive]]
 pre-receive
 -----------
-- 
1.5.3.2.89.g296e
Previous: Josh EnglandNext: Junio C Hamano
Message 3 of 6 in “post-checkout hooks and related tests”
  1. post-checkout hooks and related testsJosh England, Sep 25, 2007
  2. post-merge hook and related testsJosh England, Sep 25, 2007
  3. Documentation for post-checkout and post-merge hooksJosh England, Sep 25, 2007
  4. Junio C HamanoSep 25, 2007
  5. Junio C HamanoSep 25, 2007
  6. Josh EnglandSep 26, 2007

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.