[PATCH] diff: graduate word-diff option from experimental

Anton Shestakov av6 at dwimlabs.net
Thu Jul 12 00:22:31 EDT 2018


On Wed, 11 Jul 2018 23:08:37 +0530
Pulkit Goyal <7895pulkit at gmail.com> wrote:

> On Mon, Jul 9, 2018 at 6:29 PM Yuya Nishihara <yuya at tcha.org> wrote:
> 
> > On Sun, 8 Jul 2018 18:29:37 +0530, Pulkit Goyal wrote:
> > > > --- a/mercurial/help/config.txt
> > > > +++ b/mercurial/help/config.txt
> > > > @@ -702,6 +702,9 @@ for related options for the annotate com
> > > >  ``unified``
> > > >      Number of lines of context to show.
> > > >
> > > > +``word-diff``
> > > > +    Highlight changed words.
> > > > +
> > > >
> > >
> > > ​TBH, I am not fan of documenting config options in `hg help config`.
> > > Rather we should document this in commands' help text where it is
> > > applicable so that this is more discoverable.​

`hg help diff` actually sort of does document useful diff options...
just because they are also command-line options, such as:

 -g --git                 use git extended diff format
 -p --show-function       show which function each change is in
 -w --ignore-all-space    ignore white space when comparing lines
 -b --ignore-space-change ignore changes in the amount of white space
 -B --ignore-blank-lines  ignore changes whose lines are all blank
 -U --unified NUM         number of lines of context to show

They are all configurable in .hgrc.

(Should we have --word-diff option too now that it's not experimental?)

> > I agree that it's nice if each command help includes reference to related
> > configs, but I think 'help config' should be the canonical source of all
> > supported options. Otherwise we would have to grep all command helps to
> > find a meaning of a certain config option.
> >
> 
> ​Can't we have the documentation at both places? I don't think that's
> harmful.​

But blowing up line count of hg help is harmful, and that would happen
if we told .hgrc equivalent for each and every command-line option
right on the spot. Instead, how about something like "most of these
options exist as configuration file options, see hg help config.diff"?
I couldn't find any other `hg help cmd` that refers to `hg help
config.cmd` as of yet, but it's probably because other commands don't
have their own .hgrc section.


More information about the Mercurial-devel mailing list