From the Canyon Edge -- :-Dustin

Tuesday, October 19, 2010

Bikeshed: bzrp (bzr with a sensible-pager)

I'll admit it ... I'm a huge fan of bzr. I'm conversational in git, but I really love the ease of use of bzr. It's friendly, convenient, and well documented.

I really only have one complaint... I really wish it paged output to sensible-pager, when running in an interactive terminal and the output is more than one screen-full.

I talked to Robert Collins about this in Wellington at LCA2010 earlier this year. He was lukewarm to the idea, asking me why don't I just pipe the output to sensible-pager. Heh. Sure, I can do that.

Okay, okay, so I created a simple alias, and eventually this wrapper script, bzrp, which basically has that effect.

Try it for yourself!
bzrp log --include-merges
bzrp diff
bzrp cdiff
This works with any bzr command that has output on standard out.

For what it's worth, I'm pronouncing this "ba-zerp" for now :-)

If you find this useful, install the bikeshed package from Natty, or from the Bikeshed PPA for other versions of Ubuntu.



  1. You can also do this:

    mkdir -p ~/.bazaar/plugins
    bzr branch lp:bzr-pager ~/.bazaar/plugins/bzr-pager

    And all bzr commands will be paged.

  2. Hi Dustin,
    there is also a plugin for bzr which directs output of various commands to $PAGER, I'm using it since ages, and I'm very happy with it ;)
    bzr get

  3. I've been using

  4. Dustin: fyi there was a bzr-pager plugin previously that auto-pipes all commands to sensible-pager. Though I quite like your version, using a different prefix cmd :)

  5. Is this different to the bzr-pager plugin? One of my new-install tasks is to run “bzr branch lp:bzr-pager pager” in ~/.bazaar/plugins.

  6. Ah, interesting. Thanks everyone for the pointer to bzr-pager.

    I did apt-cache search for something like this, but turned up no hits.

    Doesn't look like bzr-pager is packaged yet?


  7. Please add grievances to bug #213718 (or one of its dups)! It's one of those things that really should have been fixed for everyone by now.

  8. sladen,

    Ah, yes, thanks:


  9. I looks like bzrp doesn't handle arguments with spaces in them. You may need to quote "$@".

    I'be been using a script for bzr diff and bzr log to add pagination/colourizing, e.g. my ~/bin/bzrdiff is (going to be horrendously mangled on this blog, I bet)

    # bzr diff with nice colours
    args="--diff-options=-p $@"
    if test -t 1 && test -x /usr/bin/colordiff; then
    # stdout is a tty
    exec bzr diff $args|colordiff|less -R
    exec bzr diff $args

  10. Thanks Marius. I just committed a fix.


Please do not use blog comments for support requests! Blog comments do not scale well to this effect.

Instead, please use Launchpad for Bugs and StackExchange for Questions.