Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

moved regexp to git config

  • Loading branch information...
commit cc8940a5f0b26b722eb386b0f1ef4e10f2afa075 1 parent 8342839
Jonas Genannt authored

Showing 1 changed file with 11 additions and 2 deletions. Show diff stats Hide diff stats

  1. +11 2 git-hooks/pre-receive
13 git-hooks/pre-receive
@@ -3,9 +3,18 @@
3 3 # Licensed under the Apache License, Version 2.0
4 4
5 5 # regular expression for tag names
6   -tag_regexp = '^(prod|dev)\/[0-9]{4}-[0-9]{2}-[0-9]{2}_d[0-9]+$'
  6 +# git config hooks.receivetagregexp '^prod\/[0-9]{4}-[0-9]{2}-[0-9]{2}_d[0-9]+$'
7 7
8   -rexp = Regexp.new(tag_regexp)
  8 +tag_regexp = %x{git config hooks.receivetagregexp}.strip
  9 +
  10 +exit 0 if tag_regexp == ""
  11 +
  12 +begin
  13 + rexp = Regexp.new(tag_regexp)
  14 +rescue Exception => e
  15 + puts "Error: Could not parse regexp: #{e.message}"
  16 + exit 1
  17 +end
9 18
10 19 message = Array.new
11 20 while line = STDIN.gets

0 comments on commit cc8940a

Please sign in to comment.
Something went wrong with that request. Please try again.