aboutsummaryrefslogtreecommitdiff
path: root/transport.h
diff options
context:
space:
mode:
authorAaron Schrab <aaron@schrab.com>2013-01-13 00:17:03 -0500
committerJunio C Hamano <gitster@pobox.com>2013-01-18 11:13:22 -0800
commitec55559f937727bcb0fa8a3dfe6af68c188e968a (patch)
treec77a367930b6be70b01348c443fd09c4a1e8e836 /transport.h
parent5a7da2dca166fab74f4514697e26dd80e79933f5 (diff)
downloadgit-ec55559f937727bcb0fa8a3dfe6af68c188e968a.tar.gz
git-ec55559f937727bcb0fa8a3dfe6af68c188e968a.tar.xz
push: Add support for pre-push hooks
Add support for a pre-push hook which can be used to determine if the set of refs to be pushed is suitable for the target repository. The hook is run with two arguments specifying the name and location of the destination repository. Information about what is to be pushed is provided by sending lines of the following form to the hook's standard input: <local ref> SP <local sha1> SP <remote ref> SP <remote sha1> LF If the hook exits with a non-zero status, the push will be aborted. This will allow the script to determine if the push is acceptable based on the target repository and branch(es), the commits which are to be pushed, and even the source branches in some cases. Signed-off-by: Aaron Schrab <aaron@schrab.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.h')
-rw-r--r--transport.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/transport.h b/transport.h
index bfd2df582..ac5a9f57d 100644
--- a/transport.h
+++ b/transport.h
@@ -104,6 +104,7 @@ struct transport {
#define TRANSPORT_RECURSE_SUBMODULES_CHECK 64
#define TRANSPORT_PUSH_PRUNE 128
#define TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND 256
+#define TRANSPORT_PUSH_NO_HOOK 512
#define TRANSPORT_SUMMARY_WIDTH (2 * DEFAULT_ABBREV + 3)
#define TRANSPORT_SUMMARY(x) (int)(TRANSPORT_SUMMARY_WIDTH + strlen(x) - gettext_width(x)), (x)