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

RE: [TSVN] issuetrackers and regex

From: Eric J. Smith <eric_at_ericjsmith.net>
Date: 2005-02-12 01:10:59 CET

Looks like for named group in a POSIX regex engine you would use:

(?:fix(?:es)?|close(?:s)?)\s+(?:(?:\s+and\s+)?\#(?P<id>\d+))+

It also looks like GRETA doesn't support named groups. It looks like it
does support grouping though so you should be able to do this instead:

(?:fix(?:es)?|close(?:s)?)\s+(?:(?:\s+and\s+)?\#(\d+))+

That should only return the issue numbers as groups.

Anyway, I think if you are going to include a regex engine, unless there is
a huge size difference, then it should be the most feature complete and
POSIX compliant regex engine you can find. Otherwise you are going to be
answering a lot of questions about what syntax it does and doesn't support.

Eric J. Smith

> -----Original Message-----
> From: Eric J. Smith [mailto:eric@ericjsmith.net]
> Sent: Friday, February 11, 2005 1:48 PM
> To: dev@tortoisesvn.tigris.org
> Subject: RE: [TSVN] issuetrackers and regex
>
> Stefan,
>
> I for one thing this is going to be a great feature. I love how Trac just
> lets you type stuff like "fixes 12" or "closes 12" into your log message
> and
> it picks those up and acts on them. I guess from a TSVN perspective your
> regex will just pick these up and turn them into links? Or do you add
> properties to the changeset that indicate what items were affected as
> well?
>
> As far as the regex library is concerned, I would think it would have to
> be
> able to support something like:
>
> (fix(es)?|close(s)?)\s+((\s+and\s+)?\#(?<id>\d+))+
>
> This will capture different variations and also capture all of the issue
> numbers to a named group so that you will be able to pick them out and do
> whatever you need to with them.
>
> Eric J. Smith
>
> > -----Original Message-----
> > From: SteveKing [mailto:steveking@gmx.ch]
> > Sent: Friday, February 11, 2005 12:16 PM
> > To: dev@tortoisesvn.tigris.org
> > Subject: Re: [TSVN] issuetrackers and regex
> >
> > Mark Phippard wrote:
> > > I think I was the original person to suggest using RegEx, although
> > perhaps
> > > the idea has "morphed" into other areas.
> >
> > You were the first one, yes. But by far not the only one ;)
> >
> > > When I suggested it, the RegEx would have been used to validate the
> > issue
> > > ID. As such, it would really just need to be run on the text typed
> into
> > > that field, not the entire log message. I think this would have just
> > been
> > > for simple validations, similar to what we already provide to say if
> an
> > > issue ID is numeric. In my system, as an example, the Bug ID string
> > would
> > > always have to be 8 or 10 total characters, so I might provide an
> > > expression to validate that. Some people use systems with complicated
> > > ID's like ABCD/123 that could also have a simple validation
> performed.
> >
> > With regex linked to TSVN, this would be an easy thing to implement. And
> > I already put that in the specs.
> >
> > > You pretty much convinced me that this isn't really needed.
> >
> > Not really for checking, yes.
> >
> > > So to come back to your question, I don't understand what you would be
> > > using expressions for? Is it just to identify the bug ID's in a log
> > > message so that you know what to turn into hyperlinks? Does that
> really
> > > need that much improving? Are you thinking of some new UI such as
> > showing
> > > the Bug ID's separate from the log message and this is how you would
> > > extract them?
> >
> > People requested TSVN to extract certain strings from a log message and
> > turn it into a link. Also, some tools like trac
> > (http://projects.edgewall.com/trac/) can even parse a log message for
> > strings like
> > "
> > Changed blah and foo to do this or that. Fixes #10 and #12,
> > and refs #12.
> >
> > This will close #10 and #12, and add a note to #12.
> > "
> > and close/fix/reference/add note to the mentioned issue (called 'ticket'
> > there).
> >
> > So there's definitely a request for such a feature implemented in TSVN
> > too! Also, I found myself needing a regex lib for something else I've
> > planned to implement in TSVN so I thought that adding another 400kB
> > isn't that bad anymore (it still would be for just _one_ feature, but I
> > can use it for another one too).
> >
> > So the regex would be used to extract the bug ID's from a log message as
> > trac does it and turn them into links. And of course while we have that
> > regex defined it can also be used to check the validity of an entered
> > bug ID.
> > Kind of like an enhancement to the current specs.
> >
> > Stefan
> >
> > --
> > ___
> > oo // \\ "De Chelonian Mobile"
> > (_,\/ \_/ \ TortoiseSVN
> > \ \_/_\_/> The coolest Interface to (Sub)Version Control
> > /_/ \_\ http://tortoisesvn.tigris.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
> > For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
> For additional commands, e-mail: dev-help@tortoisesvn.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Sat Feb 12 01:13:49 2005

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

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