[PLUGIN] Lesslog -> run bzr log through less automatically
Michael Ellerman
michael at ellerman.id.au
Sun Dec 11 20:17:59 GMT 2005
On Fri, 9 Dec 2005 09:10, John Arbash Meinel wrote:
> Michael Ellerman wrote:
> > http://michael.ellerman.id.au/files/bzr/lesslog
>
> We should only invoke a pager if the number of lines are going to be
> more than a screenful, and sys.stdout is a tty. You probably are doing
> the latter, though I doubt you are doing the former. (You would have to
> wrap up the output to figure out how long it is, etc).
Frankly I don't think it's worth the complexity to try and work out if there's
more than a screenful of lines. For most cases there will be > 1 screen of
lines, and when there isn't you just have to hit 'q' anyway.
I don't check for stdout being a tty, I guess I should. Although less/more
_do_ check, so "bzr ll > foo" works just fine. Other pagers probably don't.
> More important is that I think using 'less' is just a workaround for a
> bad design. Which is that "bzr log" prints out the entire log. All 1500
> revisions (+ merged revisions). Which is why it has to print it in
> reverse, so that you can run less, and why it needs to start printing
> right away, because it takes too long to read all 1500 entries. And why
> we had problems with "broken pipe" messages, because people weren't
> waiting (and shouldn't have to).
I disagree here. I think there's several use-cases for bzr log, one is
checking what the head revision is, seeing what you just pulled, what you're
about to push, searching through history for a change .. etc.
I think piping through less is the best compromise between these at the
moment.
Having said that, we should fix "bzr missing" (currently it doesn't understand
merges) and make sure it produces sensible output for both pull and push
cases.
And perhaps pull should display the log of pulled revisions by default, with
the current behaviour selected with '-q'.
cheers
--
Michael Ellerman
IBM OzLabs
email: michael:ellerman.id.au
inmsg: mpe:jabber.org
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051211/0afbc8b0/attachment.pgp
More information about the bazaar
mailing list