Skip to content

Instantly share code, notes, and snippets.

View danlyh5288's full-sized avatar

Dan danlyh5288

  • Microsoft
  • Toronto
  • 17:46 (UTC -04:00)
View GitHub Profile
@gortok
gortok / pre-receive.py
Last active June 8, 2020 12:39
Python Pre Receive hook for checking commit messages
#!/bin/python
import sys
import re
import subprocess
#Format: "oldref newref branch"
line = sys.stdin.read()
(base, commit, ref) = line.strip().split()
new_branch_push = re.match(r'[^1-9]+', base)