Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support multiple ping URLs per repository

  • Loading branch information...
commit bd306bc98cd7b137bb7d6441a5d6c4eb986fed0b 1 parent df4138f
@mhagander authored
Showing with 11 additions and 7 deletions.
  1. +4 −3 README.rst
  2. +7 −4 commitmsg.py
View
7 README.rst
@@ -42,7 +42,7 @@ configuration for the script. It should contain something like: ::
commitmsg = 1
tagmsg = 1
branchmsg = 1
- pingurl = 1
+ pingurl = http://somewhere.com/git_repo_updated
Expansion variables are available for the following fields:
@@ -68,9 +68,10 @@ commitmsg, tagmsg, branchmsg
set to 0 to disable generating this type of message. If unspecified or
set to anything other than 0, the mail will be sent.
pingurl
- set to an URL to make the script send an empty HTTP post to this URL
+ set to one or more URLs to make the script send an empty HTTP post to this URL
whenever something is received. This is useful for example to trigger
- a redmine installation to pull the repository.
+ a redmine installation to pull the repository. Separate multiple URLs with
+ spaces.
git policy enforcement script
View
11 commitmsg.py
@@ -342,7 +342,10 @@ def parse_annotated_tag(lines):
# Send of a http POST ping if there is something changed
if c.has_option('commitmsg', 'pingurl'):
- pingurl = c.get('commitmsg', 'pingurl')
- # Make a http POST (the empty content makes it a POST)
- ret = urllib.urlopen(pingurl, '').read()
- # We ignore what the result is...
+ for pingurl in c.get('commitmsg', 'pingurl').split(' '):
+ # Make a http POST (the empty content makes it a POST)
+ # We ignore what the result is, so we also ignore any exceptions.
+ try:
+ ret = urllib.urlopen(pingurl, '').read()
+ except:
+ pass
Please sign in to comment.
Something went wrong with that request. Please try again.