bzrp log --include-merges
bzrp diff
bzrp cdiff
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!
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.
:-Dustin
10 comments:
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.
* bugs.launchpad.net
* stackexchange.com
Thanks,
:-Dustin
Subscribe to:
Post Comments (Atom)
You can also do this:
ReplyDeletemkdir -p ~/.bazaar/plugins
bzr branch lp:bzr-pager ~/.bazaar/plugins/bzr-pager
And all bzr commands will be paged.
Hi Dustin,
ReplyDeletethere 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 http://bzr.oxygene.sk/bzr-plugins/pager/
I've been using https://launchpad.net/bzr-pager
ReplyDeleteDustin: 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 :)
ReplyDeletehttps://launchpad.net/bzr-pager
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.
ReplyDeleteAh, interesting. Thanks everyone for the pointer to bzr-pager.
ReplyDeleteI did apt-cache search for something like this, but turned up no hits.
Doesn't look like bzr-pager is packaged yet?
:-Dustin
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.
ReplyDeletesladen,
ReplyDeleteAh, yes, thanks:
https://bugs.edge.launchpad.net/bzr/+bug/213718/comments/11
:-Dustin
I looks like bzrp doesn't handle arguments with spaces in them. You may need to quote "$@".
ReplyDeleteI'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)
#!/bin/bash
# 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
else
exec bzr diff $args
fi
Thanks Marius. I just committed a fix.
ReplyDelete