From 16f2708025077d94658628969a9dca8105ce5f20 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 06 2015 14:12:21 +0000 Subject: Improve the regex for `relates to` commits This way we'll get the link even if the `relates to` is in the middle of the text --- diff --git a/progit/hooks/files/progit_hook.py b/progit/hooks/files/progit_hook.py index a58daea..21b2824 100644 --- a/progit/hooks/files/progit_hook.py +++ b/progit/hooks/files/progit_hook.py @@ -33,7 +33,7 @@ RELATES = [ re.compile('.*\s+relate[sd]?:?\s?#(\d+)', re.I), re.compile( 'relate[sd]?:?\s?(?:to)?\s?https?://.*/(\w+)/issue/(\d+)', re.I), - re.compile('.*\s+relate[sd]?:?\s?https?://.*/(\w+)/issue/(\d+)', re.I), + re.compile('.*\s+relate[sd]?:?\s?(?:to)?\s?https?://.*/(\w+)/issue/(\d+)', re.I), ]