List Info

Thread: Being smart about proffered changes




Being smart about proffered changes
user name
2006-11-08 23:50:14
This is definitely in "You're right --- do you have a
patch?" territory, but:

It's annoying when 'darcs record' prints a *very* large hunk
before
asking 'record this patch?'  It should summarize large hunks
somehow;
I don't like having my entire scrollback occupied by the
ex-contents
of a TAGS file I didn't mean to record.

Hmm, and TAGS should be in the default "boring"
filename pattern list.
 That I could probably figure out how to do, even without
knowing
Haskell.

_______________________________________________
darcs-users mailing list
darcs-usersdarcs.net
http://www.abridgegame.org/mailman/listinfo/darcs-users
Being smart about proffered changes
user name
2006-11-09 00:59:03
On Wed, Nov 08, 2006 at 03:50:14PM -0800, Jim Blandy wrote:
> This is definitely in "You're right --- do you
have a patch?" territory, but:
> 
> It's annoying when 'darcs record' prints a *very* large
hunk before
> asking 'record this patch?'  It should summarize large
hunks somehow;
> I don't like having my entire scrollback occupied by
the ex-contents
> of a TAGS file I didn't mean to record.

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?

-- Jamie Webb

_______________________________________________
darcs-users mailing list
darcs-usersdarcs.net
http://www.abridgegame.org/mailman/listinfo/darcs-users
Being smart about proffered changes
user name
2006-11-09 06:29:07
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 09-11-06 01:59, Jamie Webb schreef:
> On Wed, Nov 08, 2006 at 03:50:14PM -0800, Jim Blandy
wrote:
>> This is definitely in "You're right --- do you
have a patch?" territory, but:
>>
>> It's annoying when 'darcs record' prints a *very*
large hunk before
>> asking 'record this patch?'  It should summarize
large hunks somehow;
>> I don't like having my entire scrollback occupied
by the ex-contents
>> of a TAGS file I didn't mean to record.
> 
> 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.

Groetjes,
 <><
Marnix
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


iD8DBQFFUsqyjn9v+6JsL6sRAiLkAKDU4W0F0jdS9p3SOjmjnUDWF55y2wCf
UYVY
U5i9HLLhnBgKRgHeOwtyuFo=
=LK4o
-----END PGP SIGNATURE-----

_______________________________________________
darcs-users mailing list
darcs-usersdarcs.net
http://www.abridgegame.org/mailman/listinfo/darcs-users
Being smart about proffered changes
user name
2006-11-09 12:35:35
On 11/9/06, Marnix Klooster <marnix.kloostergmail.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

_______________________________________________
darcs-users mailing list
darcs-usersdarcs.net
http://www.abridgegame.org/mailman/listinfo/darcs-users
Being smart about proffered changes
user name
2006-11-09 16:05:47
On Thu, Nov 09, 2006 at 08:35:35PM +0800, Nimrod A. Abing
wrote:
> On 11/9/06, Marnix Klooster <marnix.kloostergmail.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.

That doesn't work so well with coloured output. more will
leave it
unchanged, but most distributions default $PAGER to less and
that
needs the -R option, otherwise it will render the escapes in
hex.
Maybe try in order:

- $DARCS_PAGER
- less -R
- $PAGER
- more

Or would it be better to check if $PAGER matches (^|/)less$
and add -R
if necessary?

Windows users are obviously stuck with more unless they go
out of
their way.

> The behavior controlled by DARCS_PAGER_LINES can be
implemented by
> using LINES since darcs already uses ncurses(?).

Not directly. I would find it very annoying if darcs called
the pager
every time a patch is just a little over a page: I'd rather
just
scroll my terminal. I see this is as only being useful for
much longer
patches.

> 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.

Bash and (I think) zsh also set $LINES, so that shouldn't be
much of a
problem. Hopefully csh/ksh are dead by now...

-- Jamie Webb

_______________________________________________
darcs-users mailing list
darcs-usersdarcs.net
http://www.abridgegame.org/mailman/listinfo/darcs-users
Being smart about proffered changes
user name
2006-11-09 18:57:37
> > >> 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.

Please, please, if you do anything like this, be sure to
provide a way
to disable the feature.  I always run my shell in an Emacs
buffer/window, and programs like "less" don't play
nicely in that
environment. 


Cheers,
 - arb

_______________________________________________
darcs-users mailing list
darcs-usersdarcs.net
http://www.abridgegame.org/mailman/listinfo/darcs-users
[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )