summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-07-07 05:09:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-07-07 05:09:13 (GMT)
commit33a22c1a88d8e8cddd41ea0aa264ee213ce9c1d7 (patch)
treefc494f73186a6d215d1f9dd71bb182068804eda4 /Documentation
parent12210859da0c16c644dab658d9e1ef671ec28788 (diff)
parent675415976704459edaf8fb39a176be2be0f403d8 (diff)
downloadgit-33a22c1a88d8e8cddd41ea0aa264ee213ce9c1d7.zip
git-33a22c1a88d8e8cddd41ea0aa264ee213ce9c1d7.tar.gz
git-33a22c1a88d8e8cddd41ea0aa264ee213ce9c1d7.tar.bz2
Merge branch 'ps/ref-transaction-hook'
A new hook. * ps/ref-transaction-hook: refs: implement reference transaction hook
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/githooks.txt29
1 files changed, 29 insertions, 0 deletions
diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
index 81f2a87..6424711 100644
--- a/Documentation/githooks.txt
+++ b/Documentation/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
~~~~~~~~~~~~~~~~