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

[PATCH v1 3/3] read-cache: Add documentation for the post-indexchanged hook

From
Ben Peart <peartben@gmail.com>
Date
Feb 8, 2019, 19:51 UTC
Message-ID
<20190208195115.12156-4-peartben@gmail.com>
In-Reply-To
<20190208195115.12156-1-peartben@gmail.com>
From: Kevin Willford <kewillf@microsoft.com>

Document the new post-indexchanged hook with information on when it is called as well as the flags passed and what each of them mean.

Signed-off-by: Kevin Willford <kewillf@microsoft.com>
Signed-off-by: Ben Peart <benpeart@microsoft.com>
---
 Documentation/githooks.txt | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
index 959044347e..9349cd8900 100644
--- a/Documentation/githooks.txt
+++ b/Documentation/githooks.txt
@@ -492,6 +492,24 @@ This hook is invoked by `git-p4 submit`. It takes no parameters and nothing
 from standard input. Exiting with non-zero status from this script prevent
 `git-p4 submit` from launching. Run `git-p4 submit --help` for details.
 
+post-indexchanged
+~~~~~~~~~~~~~~~~~
+
+This hook is invoked when the index is written in read-cache.c
+do_write_locked_index.
+
+The first parameter passed to the hook is the indicator for the
+working directory being updated.  "1" meaning working directory
+was updated or "0" when the working directory was not updated.
+
+The second parameter passed to the hook is the indicator for whether
+or not the index was updated and the skip-worktree bit could have
+changed.  "1" meaning skip-worktree bits could have been updated
+and "0" meaning they were not.
+
+Only one parameter should be set to "1" when the hook runs.  The hook
+running passing "1", "1" should not be possible.
+
 GIT
 ---
 Part of the linkgit:git[1] suite
-- 
2.20.1.windows.1
Previous: Ben PeartNext: Ben Peart
Message 5 of 13 in “Add post-indexchanged hook”
  1. 0/3 Add post-indexchanged hookBen Peart, Feb 8, 2019
  2. 1/3 read-cache: add post-indexchanged hookBen Peart, Feb 8, 2019
  3. brian m. carlsonFeb 8, 2019
  4. Ben PeartFeb 12, 2019
  5. 3/3 read-cache: Add documentation for the post-indexchanged hookBen Peart, Feb 8, 2019
  6. 2/3 read-cache: add test for post-indexchanged hookBen Peart, Feb 8, 2019
  7. read-cache: add post-indexchanged hookBen Peart, Feb 14, 2019
  8. Ramsay JonesFeb 14, 2019
  9. Junio C HamanoFeb 14, 2019
  10. Ben PeartFeb 15, 2019
  11. Junio C HamanoFeb 15, 2019
  12. Ben PeartFeb 15, 2019
  13. read-cache: add post-index-change hookBen Peart, Feb 15, 2019

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.