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

[PATCH] git-commit: Pass commit SHA-1 hash to post-commit hook.

From
David Symonds <dsymonds@gmail.com>
Date
Nov 14, 2007, 00:29 UTC
Message-ID
<11950001762286-git-send-email-dsymonds@gmail.com>
Signed-off-by: David Symonds <dsymonds@gmail.com>
---
 Documentation/hooks.txt |    4 ++--
 git-commit.sh           |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/hooks.txt b/Documentation/hooks.txt
index f110162..d5b18f1 100644
--- a/Documentation/hooks.txt
+++ b/Documentation/hooks.txt
@@ -81,8 +81,8 @@ The default 'commit-msg' hook, when enabled, detects duplicate
 post-commit
 -----------
 
-This hook is invoked by `git-commit`.  It takes no
-parameter, and is invoked after a commit is made.
+This hook is invoked by `git-commit`.  It is passed one
+parameter (the new commit's SHA-1 hash), and is invoked after a commit is made.
 
 This hook is meant primarily for notification, and cannot affect
 the outcome of `git-commit`.
diff --git a/git-commit.sh b/git-commit.sh
index 4853397..fff58cb 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -616,7 +616,7 @@ then
 	git gc --auto
 	if test -x "$GIT_DIR"/hooks/post-commit
 	then
-		"$GIT_DIR"/hooks/post-commit
+		"$GIT_DIR"/hooks/post-commit $commit
 	fi
 	if test -z "$quiet"
 	then
-- 
1.5.3.1
Message 1 of 1 in “git-commit: Pass commit SHA-1 hash to post-commit hook.”
  1. git-commit: Pass commit SHA-1 hash to post-commit hook.David Symonds, Nov 14, 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.