Can "bzr annotate" be sped up?
Eric Siegerman
lists08-bzr at davor.org
Tue Jun 21 13:20:18 UTC 2011
On Mon, 2011-06-20 at 09:28 +0200, John Meinel wrote:
> bzr annotate --show-ids | (Filter out the revision-id for the line you
care about)
It would enhance scriptability (and help Eli to tie annotation
into an Emacs UI :-)) if "bzr annotate" had an option to make it
spit out, not the annotated source file, but just the annotations
themselves, i.e. a list of tuples (not necessarily in Python
syntax):
(line_number, revid, ...)
where "..." is whatever else proves useful in practice -- date,
revno, committer, perhaps the full text of the line itself.
These would be in no particular order, i.e. in whatever order is
most convenient for "annotate" to produce.
For now, the gains would be more or less cosmetic as, IIUC,
line-number order is currently no less convenient than any other.
The only real advantage is that, not being limited by screen real
estate, the tuples could include more, and unabbreviated,
fields.
But with a searching-backward-from-head algorithm, the list of
tuples would be a huge performance win for scripting, as each
one would be written as it was discovered, i.e. in
graph-traversal order, and the consumer could stop reading as
soon as it had the tuples for all the lines of interest.
So the question is, would this provide enough benefit *now*, from
more fields and perhaps easier parsing, to be worth the effort?
If not, it's probably YAGNI, as an annotation cache might well
obviate the need for the underlying algorithm to ever change...
- Eric
More information about the bazaar
mailing list