summaryrefslogtreecommitdiffstats
path: root/githooks.txt
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-07-06 22:35:57 -0700
committerJunio C Hamano <gitster@pobox.com>2020-07-06 22:35:57 -0700
commita89117826695bd15a06ab893f088622d58d49b0f (patch)
tree70a28e4da17998aca0ba3e65532c146377dc655b /githooks.txt
parentcb66540f7a8e62233e4f403871e927e8de01bb3f (diff)
downloadgit-htmldocs-a89117826695bd15a06ab893f088622d58d49b0f.tar.gz
Autogenerated HTML docs for v2.27.0-343-g4a0fcf
Diffstat (limited to 'githooks.txt')
-rw-r--r--githooks.txt29
1 files changed, 29 insertions, 0 deletions
diff --git a/githooks.txt b/githooks.txt
index 81f2a87e8..642471109 100644
--- a/githooks.txt
+++ b/githooks.txt
@@ -404,6 +404,35 @@ Both standard output and standard error output are forwarded to
`git send-pack` on the other end, so you can simply `echo` messages
for the user.
+ref-transaction
+~~~~~~~~~~~~~~~
+
+This hook is invoked by any Git command that performs reference
+updates. It executes whenever a reference transaction is prepared,
+committed or aborted and may thus get called multiple times.
+
+The hook takes exactly one argument, which is the current state the
+given reference transaction is in:
+
+ - "prepared": All reference updates have been queued to the
+ transaction and references were locked on disk.
+
+ - "committed": The reference transaction was committed and all
+ references now have their respective new value.
+
+ - "aborted": The reference transaction was aborted, no changes
+ were performed and the locks have been released.
+
+For each reference update that was added to the transaction, the hook
+receives on standard input a line of the format:
+
+ <old-value> SP <new-value> SP <ref-name> LF
+
+The exit status of the hook is ignored for any state except for the
+"prepared" state. In the "prepared" state, a non-zero exit status will
+cause the transaction to be aborted. The hook will not be called with
+"aborted" state in that case.
+
push-to-checkout
~~~~~~~~~~~~~~~~