From ec47a7444e8632c223eaf88836c0ae5083a1d03d Mon Sep 17 00:00:00 2001 From: Per Andersson Date: Tue, 31 Aug 2010 18:11:30 +0800 Subject: [PATCH] Elaborated on difference between hookscripts and hooks. --- README | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/README b/README index c3e91e8..d156bb1 100644 --- a/README +++ b/README @@ -51,9 +51,27 @@ Custom GitZilla If you need the hooks to do other stuff apart from just the Bugzilla integration, you could write your hook as a Python script and leave the -Bugzilla stuff to one of the functions from ``gitzilla.hooks``. +Bugzilla stuff to functions from ``gitzilla.hookscripts`` or +``gitzilla.hooks``. -In fact with the defaults, the ready scripts are equivalent to the following: +In fact with the defaults, are equivalent to the following: + +post-receive:: + + #!/usr/bin/python + from gitzilla.hookscripts import post_receive + post_receive() + + +update:: + + #!/usr/bin/python + from gitzilla.hookscripts import update + update() + +The functions from ``gitzilla.hookscripts`` parse and pick up values from the +configuration files. If you want to taylor more use the functions from +``gitzilla.hooks``. post-receive:: @@ -61,15 +79,11 @@ post-receive:: from gitzilla.hooks import post_receive post_receive("https://repo.example.com/bugzilla", "username", "password") - update:: #!/usr/bin/python from gitzilla.hooks import update - update() - -The provided ready scripts do more, but that's just parsing and picking up -values from the configuration files. + update("https://repo.example.com/bugzilla", "username", "password") You could pass a custom bug id extraction regex and your own logging.Logger instance. The update hook function also accepts an array of allowed bug status