[darcs-users] Being smart about proffered changes

Nimrod A. Abing nimrod.abing at gmail.com
Thu Nov 9 12:35:35 UTC 2006


On 11/9/06, Marnix Klooster <marnix.klooster at gmail.com> wrote:
> > How about piping into 'less -R' if the hunk is longer than X lines?
> > Where X might be specified either directly or as a multiple of $LINES?
>
> Or use the industry standard *grin* : pipe through $PAGER, defaulting to
> the "more" binary in your path.  (Windows?)  And perhaps a separate
> variable DARCS_PAGER_LINES to specify the cut-off X: if the patch is
> less than X lines, don't call $PAGER.
>
> I think the git people have had a similar discussion on their mailing
> list a long time ago; search the git mailing list.

I've always wanted to have something like this in darcs. It can prove
very useful when reviewing very long swaths of changes and you're on a
VT instead of an XTerm where you have the luxury of having a
scrollbar.

The behavior controlled by DARCS_PAGER_LINES can be implemented by
using LINES since darcs already uses ncurses(?). LINES is set by
initscr() so you can use that to automatically determine if a pager is
needed for the patch. Of course, this breaks if your darcs was built
--without-curses.
-- 
_nimrod_a_abing_

[?] http://abing.gotdns.com




More information about the darcs-users mailing list