Browse Source

update hook

Oz N Tiram 9 years ago
parent
commit
7b78e7f1b6
1 changed files with 10 additions and 7 deletions
  1. 10 7
      hooks/postpush

+ 10 - 7
hooks/postpush

@@ -24,9 +24,6 @@ See below.
 # [patch.new_file_path for patch in repo.diff('HEAD', 'HEAD~1'))]
 
 
-SUBMIT_HOST = '192.168.1.100'
-SUBMIT_PORT = 5000
-GIT_URL = "git@yourhost.domain:oz123/frank.git"
 
 """
 This scripts submit a very simplified json record witht the following 
@@ -49,6 +46,10 @@ information::
 
 """
 
+SUBMIT_HOST = '192.168.1.100'
+SUBMIT_PORT = 5000
+GITURL = "git@yourhost.domain:oz123/frank.git"
+
 from pygit2 import Repository
 
 repo = Repository('..')
@@ -57,12 +58,14 @@ commit = head.get_object()
 
 json_to_submit = {}
 
-json_to_submit['commit'] = head.id
+json_to_submit['commit'] = commit.id
 json_to_submit['branch'] = repo.head.shorthand
 json_to_submit['committer'] = {'email': commit.committer.email, 
-                               'name', commit.committer.name}
+                               'name': commit.committer.name}
 json_to_submit['author'] = {'email': commit.author.email, 
-                            'name', commit.author.name}
+                            'name': commit.author.name}
 
-json_to_sumbit['url'] = GIT_URL
+json_to_submit['url'] = GITURL
 json_to_submit['time'] = datetime.datetime.now()
+
+print json_to_submit