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

[PATCH] Updated githooks docs to cover pre-push script

From
Scott Chacon <schacon@gmail.com>
Date
Aug 19, 2008, 19:07 UTC
Message-ID
<d411cc4a0808191207j28380749i922ae9981f3e32dd@mail.gmail.com>

The new entry covers how the pre-push script runs and outlines possible use-cases for the script.

Signed-off-by: Scott Chacon <schacon@gmail.com>
---
 Documentation/githooks.txt |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
index 046a2a7..939181f 100644
--- a/Documentation/githooks.txt
+++ b/Documentation/githooks.txt
@@ -299,6 +299,18 @@ This hook is invoked by 'git-gc --auto'. It takes
no parameter, and
 exiting with non-zero status from this script causes the 'git-gc --auto'
 to abort.

+pre-push
+-----------
+
+This hook is invoked by 'git push'. It takes no parameter, and
+exiting with non-zero status from this script causes the 'git push'
+command to abort.
+
+This script is useful for self-enforcing policies, such as running a script
+that checks for code-compliance, running automated tests, etc.  You can
+use this script to help ensure that your pushes are sane in an automatic
+fashion.
+
 GIT
 ---
 Part of the linkgit:git[1] suite
--
1.6.0.GIT
Message 1 of 1 in “Updated githooks docs to cover pre-push script”
  1. Updated githooks docs to cover pre-push scriptScott Chacon, Aug 19, 2008

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.