[PATCH 6 of 6 RFC] push: allow specifying default-push as defaultpush

Martin Geisler martin at geisler.net
Thu Aug 8 02:23:44 CDT 2013


Matt Mackall <mpm at selenic.com> writes:

> On Wed, 2013-08-07 at 13:31 -0400, Augie Fackler wrote:
>> On Wed, Aug 07, 2013 at 06:06:53PM +0200, Martin Geisler wrote:
>> > Kevin Bullock <kbullock+mercurial at ringworld.org> writes:
>> >
>> > > On 2 Aug 2013, at 9:15 AM, Augie Fackler wrote:
>> > >
>> > >> # HG changeset patch
>> > >> # User Augie Fackler <durin42 at gmail.com>
>> > >> # Date 1374709814 14400
>> > >> #      Wed Jul 24 19:50:14 2013 -0400
>> > >> # Node ID d59a05f3c4e013ecf9c7d3b40c04fa9900b7f74f
>> > >> # Parent  4c9c2538d46bed89734a465ae01dbda483154425
>> > >> push: allow specifying default-push as defaultpush
>> > >
>> > > Unlike the rest of the series, this one causes us to change the output
>> > > -- on one of our most well-publicized config options. I guess I'm -1
>> > > on this until we're ready to officially favor the
>> > > non-hyphenated/-underscored forms. Rest of the series looks fine to
>> > > me.
>> >
>> > Why would you even prefer the non-hyphenated versions? I know we use
>> > names without underscores in the Python code, but I think someone needs
>> > to explain how the arguments for that carry over to the config keys.
>
> The argument has never been "underscores are bad", it's always been
> "consistency is good". And that argument obviously applies to config
> keys just as well as source code identifiers.

Of course, I don't think anybody has argued against consistency. My
question was rather if the audience for the config files have the same
requirements as the audience for our Python code.

That is, one might argue that the identifiers in the code are
cross-referenced more than the config keys.

Writing a config file in the first place is also an exercise in
cross-referencing, but I have the impression that people edit their
config files with the manual in hand anyway -- you search for a config
key based on the description of what it does and then you copy the key
to your config file.

This is slightly different from how we write code: there we repeatedly
use the same identifier and hope to avoid double-checking if it's called
LocalRepository, local_repository, or localrepository.

That was the distinction I tried to point out.

> "How do I fix this?"
>
> "You just need to set default push."
>
> "Is that default no space push, default underscore push, or default dash
> push?"
>
> "Default dash push. Then set allow push and allow pull on the server."
>
> "They don't do anything?!"
>
> "Oh, sorry, that's allow underscore push and allow no space pull."
>
> "Are you freaking kidding me?"
>
>
> I'm not particularly attached to a particular choice of style, just
> that _there is a style_ and people (like me, fercrissake) don't need
> to repeatedly consult the manual to find out which form is used for
> each setting.

Yes, it is important that there is a consistent style. A style without
spaces is probably easiest at this point.

-- 
Martin Geisler


More information about the Mercurial-devel mailing list