[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: bugtraq:logregex and multiple bug IDs

From: David Huang <khym_at_azeotrope.org>
Date: Tue, 3 Feb 2009 09:41:45 -0600

On Feb 3, 2009, at 3:53 AM, Sam Nabialek wrote:
> I find that #(\d+) will do what you want. That is if you can ignore
> the 'issue' text. We've loosened up our format to allow bug IDs
> anywhere in the text.

 From what I can tell, the reason #(\d+) works is because TSVN finds
all matches of the regex in the commit message. With my original
"issue #(\d+)(?:, #(\d+))?", it'll link all the bug IDs in "issue #123
issue #456 issue #789". However, as you say, "#(\d+)" works if you
don't mind matching even when there's no "issue ". The regex I'd
actually like to use is more complicated; I was just asking a question
about the feature in general and giving a simple regex as an example.

That said, the policy for our devs is to try to avoid fixing multiple
(unrelated) bugs in a single commit, so in practice, TSVN only
matching the first one is fine for us. I just thought it'd be neat if
it TSVN supported the full syntax that our post-commit hook for Trac
did.

> FWIW your regex will match at most two numbers. To match more you'll
> need * instead of ? at the end.

Yeah, I know, but I don't think that makes any difference in
practice... there are still only two capturing groups in the regex, so
you can only get two IDs out of it, regardless of how many IDs the
regex matches--try it out with http://www.regular-expressions.info/javascriptexample.html
  : if you use "issue #(\d+)(?:, #(\d+))*" as the regex and "issue
#123, #456, #789" as the subject string, Show Match shows 123 and 789,
but not 456. The "*" is greedy, so it returns the last one. With the
"?", you get the first two, instead of the first and the last, which
seems more user-friendly to me.

-- 
Name: Dave Huang         |  Mammal, mammal / their names are called /
INet: khym_at_azeotrope.org |  they raise a paw / the bat, the cat /
FurryMUCK: Dahan         |  dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 33 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA 
+ PL++
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=1097197
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2009-02-03 16:42:00 CET

This is an archived mail posted to the TortoiseSVN Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.