[darcs-devel] [issue1303] proposal: make "darcs changes" interactive by default
Jim Radford
radford at blackbean.org
Tue Jan 6 18:22:41 UTC 2009
On Tue, Jan 06, 2009 at 12:57:10PM -0500, Max Battcher wrote:
> Zooko wrote:
> > New submission from Zooko <zooko at zooko.com>:
> > I just noticed that nowadays I always add "-i" when I run "darcs
> > changes". (In the olden days I always added " | less".)
Interesting. I use (with the default search set via the $LESS
environment variable)
darcs changes -v | less '+/^[^ ]+'
so I can use 'n' and 'N' by default, while still being able to search
for arbitrary text in the hunks.
I'm starting to really like the git default of outputing to $PAGER
when the output is a terminal. It's almost always what.
I can't imagine -i being better than searching in less.
> > It occurs to me that just as "darcs record" is by default interactive
> > and the user has to specify "--all" if he wants non-interactive batch
> > mode, so "darcs changes" could by default be interactive and "--all"
> > could indicate non-interactive batch mode. I've also noticed that
> > when I'm instructing newbies in how to use darcs I often have to tell
> > them to add "-i" so that they can get what they want out of running
> > "darcs changes".
This is just a sign that we should default to paging the output.
Maybe we could also set LESS='+/^[^ ]+ $LESS' in the environment for
easily skipping to the next chunk by default.
> > This might break scripts which are running "darcs changes" an
> > expecting batch mode currently, but in the long run it would be
> > better to have more user friendliness and consistency. Scripts can
> > insulate themselves against such a change by explicitly passing "--
> > all" for invocations which require batch mode.
> Any major script relying on darcs changes should probably be using
> --xml-output or --context anyway.
Hardly. If for some reason you like -i better than less, then you can
check if the output filehandle is a tty, and if so default to -i, but
please don't and use $PAGER instead. :)
-Jim
More information about the darcs-devel
mailing list