[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Subject line processing in Gnats 4.0
From: |
Dirk Bergstrom |
Subject: |
RE: Subject line processing in Gnats 4.0 |
Date: |
Wed, 12 Dec 2001 14:16:41 -0800 |
paul traina writes:
> Negative Dirk,
> I had it behave that way before, and it sucked. Every time
> someone sent in anything like "OS/2" it would append it to PR #2.
mr. traina makes a good point (he does that rather often). i had been
wrestling with this, with no great success. it's why the idea had been sitting
in my files for months. now that my memory has been jogged, i remember a
couple of solutions i'd had in mind. in order of increasing radicalism:
*) accept FW: as well as RE: -- change the subject pattern thusly:
- "(.*re[ \t]*(\\[[0-9]+\\])?:)?[ \t]*([-a-z0-9_+.]*[:/][ \t]*([0-9]+))"
+ "(.*(re|fwd?)[ \t]*(\\[[0-9]+\\])?:)?[ \t]*([-a-z0-9_+.]*[:/][ \t]*([0-9]+))"
this will require adjusting what parenthetical expression is saved out of the
match.
*) gnats currently accepts things like "sw-foo: 1234" instead of "sw-foo/1234".
i'm guessing that the former is an antiquated form, since gnats doesn't emit
it anymore. people don't use it, but they *do* use "PR1234". adjust the regex
appropriately:
+ "(.*(re|fwd?)[ \t]*(\\[[0-9]+\\])?:)?[ \t]*(([-a-z0-9_+.]*/)|pr)([0-9]+))"
this will require some futher munging of code, since the stuff that pulls out
and uses <category>/<number> will have to learn to contend with PR<number>.
since it really isn't necessary to use category to pull up the PR, it might be
best to change the regex to save only the number, and not the category/number
pair. then we could just hack out the additional parsing code.
i think that the first change is the minimum we should do.
--
Dirk Bergstrom address@hidden
_____________________________________________
Juniper Networks Inc., Computer Geek
Tel: 707.433.0564 Fax: 707.433.0769