Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=git-hooks.git;a=commitdiff;h=060eb05d3c2d961103cce22c36034cf3ec6a6439

commit 060eb05d3c2d961103cce22c36034cf3ec6a6439
Author: Miklos Vajna <[EMAIL PROTECTED]>
Date:   Mon Mar 24 14:35:11 2008 +0100

check argv[0] to see what plugins (for what hook) should we run
- also enable 'detach' for pre-receive

diff --git a/config.py b/config.py
index 799d7da..7c15773 100644
--- a/config.py
+++ b/config.py
@@ -1,4 +1,7 @@
#!/usr/bin/env python

class config:
-       enabled_plugins = ['cia', 'sendmail', 'checkout', 'synchook']
+       enabled_plugins = {
+                       "post-receive": ['cia', 'sendmail', 'checkout', 
'synchook'],
+                       "pre-receive": ['detach']
+                       }
diff --git a/git-hooks.py b/git-hooks.py
index d32a5cf..c3d4c0b 100755
--- a/git-hooks.py
+++ b/git-hooks.py
@@ -30,7 +30,8 @@ if __name__ == "__main__":
sys.path.append("/usr/share/git-hooks")
from config import config as myconfig
old, new = read_stdin()
-       for i in myconfig.enabled_plugins:
+       name = sys.argv[0].split('/')[1]
+       for i in myconfig.enabled_plugins[name]:
s = "%s.%s" % (i, i)
plugin = __import__(s)
for j in s.split(".")[1:]:
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to