[PLUGIN] Lesslog -> run bzr log through less automatically

Wouter Bolsterlee uws at xs4all.nl
Sun Dec 11 11:58:24 GMT 2005


På Fri, Dec 09, 2005 at 09:10:36AM -0600, John Arbash Meinel skrev:
> 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).

less -F does exactly this, as the manpage states:

| -F or --quit-if-one-screen
|     Causes less to automatically exit if the entire file can be displayed
|     on the first screen.


> I have my own short-log plugin, which isn't exactly the right thing to
> do, but it changes the log defaults to be --short, --forward, and print
> only the last 10 revisions. Back before it was broken, you could always
> do "bzr log -r.. --long --reverse" if you wanted the more complete display.

This is what my lastlog plugin (which is not broken) does too. You can find
my branch at http://uwstopia.nl/geek/projects/bzr/bzr-lastlog/

> For me, 10 is a rough heuristic which in short mode fills the screen,
> and frequently gives me just enough context that I know what is going on.

For me that number is 5, but I'm using the long format. I'll try short mode
for a while to see if that better suits my needs.

  mvrgr, Wouter

-- 
:wq                                                       mail uws at xs4all.nl
                                                      web http://uwstopia.nl

we'd drink and get high until late :: and now we're all alone     -- placebo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051211/7f4856d0/attachment.pgp 


More information about the bazaar mailing list