Skip to content
Browse files

Expanded regular expression to include some additional variations tha…

…t I think are useful.

My team constantly wants to write "bug 123" or "ticket 123" in the commit message. Unfortunately the old expression would only match "bugid 123". I made the ID portion optional. "Case[s]" already works great but I added "Ticket[s]" as well. Would love for this change to be applied to the service hook.
  • Loading branch information...
1 parent 791bd99 commit 410f51c6870427664008ebffb2471a6829791589 Alex Ford committed Apr 4, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 services/fog_bugz.rb
2 services/fog_bugz.rb
@@ -22,7 +22,7 @@ def receive_push
bug_list = []
message.split("\n").each do |line|
# match variants of bugids or cases
- if (line =~ /\s*(?:Bug[zs]*\s*IDs*\s*|Case[s]*)[#:; ]+((\d+[ ,:;#]*)+)/i)
+ if (line =~ /\s*(?:Bug[zs]*\s*(IDs*)?\s*|Case[s]*|Ticket[s]*)[#:; ]+((\d+[ ,:;#]*)+)/i)
bug_list << $1.to_i

0 comments on commit 410f51c

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