Bazaar Search Language brain dump
Ian Clatworthy
ian.clatworthy at internode.on.net
Fri Mar 6 04:33:30 GMT 2009
Jono,
Thinking about our discussion yesterday, I think we could do
something pretty simple yet powerful. I'll write it up as a spec soon.
Here's a brief summary though ...
1. log supports -s as a list option. Each value is a condition.
(In the future, missing ought to support -s as well.)
2. Conditions are or-ed together by default. The --match-all-searches
flag makes them and-ed together instead.
3. The syntax of a condition is ...
attribute operator value
4. Supported attributes should include message, committer, authors
and nick to begin with.
5. Supported operators are =, contains, in, !=, !contains, !in:
* '=' is an exact string match
* 'contains' is a substring match
* 'in' looks up patterns (see bzr help patterns) in a file
* ! negates the above.
6. Values are strings. Like revisionspecs and several other places in
bzr, we support value schemes:
* me: maps to the currently configured username
* env:xx maps to the environment variable xx (in a cross-platform way)
* value:xx maps to xx, allowing escaping of strings that look like a scheme.
Implementation wise, we need a search parser that converts strings
into a useful class, including the and vs or thing. We then extend
the current log filter to match a Revision against that object instead
of just always matching a plain string against the commit message.
Anyhow, something to critique/hack together on the flight to next
week's sprint. :-)
Ian C.
More information about the bazaar
mailing list