[darcs-users] Colouring and pagination

Ash Moran ash.moran at patchspace.co.uk
Sun Jan 27 17:38:31 UTC 2013


On 27 Jan 2013, at 16:27, "Stephen J. Turnbull" <stephen at xemacs.org> wrote:

> I believe there's an option to less that causes it to exit if the
> content is less than one page.  Try less -F.  -E may also be of
> interest.

Thanks Stephen, that works quite well. I've updated my aliases to use this now.

>> I suppose I could go through and make aliases for everything, but
>> it seems something darcs could do in a saner way.
> 
> Personally I prefer apps that don't make this decision for me.

It's the duplication of effort that gets me. I agree that a tool shouldn't be forcing everyone to use one particular way. But anything that has to be done with aliases is something that everyone who uses that tool has to configure themselves in their shell. (And for several years I just assumed I couldn't get coloured paginated output so I didn't even bother trying - laziness on my part really.)

The specific command here (darcs changes/log) may be an edge case. By paginating automatically, `git log` shows you the newest changes first. By not paginating, `darcs log` shows you the oldest. By and large I think git is a usability car crash, but I personally find its behaviour here more useful: I'm usually more interested in the most recent changes that the oldest.

Wanting pagination for `darcs whatsnew` may be more of a personal preference. I find it hard to navigate a diff by scrolling in the terminal. In fact this is why I also have an alias `dwsubl` to pipe the output into Sublime, (it was `dwmate` when I used TextMate). That way if I do have a lot of unrecorded changes to step through I don't interrupt my terminal session.

Another option is that as I use oh-my-zsh[1], I could write a darcs plugin and do this wrapping in there. That might be the best option, as oh-my-zsh is an opinionated project anyway, although there's a possibility that the intersection of darcs users and oh-my-zsh users is just me.

Ash

[1] https://github.com/robbyrussell/oh-my-zsh

-- 
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashmoran



More information about the darcs-users mailing list