Differences between revisions 1 and 2
Revision 1 as of 2017-01-31 12:43:32
Size: 1977
Revision 2 as of 2017-01-31 12:46:23
Size: 1965
Comment: Remove forbidden markup in headers
Deletions are marked like this. Additions are marked like this.
Line 57: Line 57:
=== Proposal: use {{{-}}} or {{{_}}} in config examples === === Proposal: use - or _ in config examples ===

/!\ This page is primarily intended for Mercurial's developers.

Configuration consolidation

Status: Project

Main proponents: DavidDemelier

/!\ This is a speculative project and does not represent any firm decisions on future behavior.

Make the .hgrc file more unified.

1. Goal

The goal of this project is to make a clear coding style regarding the .hgrc configuration options.

2. Detailed description

The current .hgrc configuration options is messed with many different styles:

  • anoption (~ 192 options, many are unreadable)
  • an_option (~ 8 options)
  • an-option (~ 7 options)

Having a unified style makes the code cleaner, better integrated.

2.1. Proposal: allow _ and - anywhere

Since we have a strong backward compatibility concern, I have a proposal that I saw in a software a long time ago. The idea is to allow adding any underscore or hyphens in options and they are simply removed when loaded from the configuration.


username = blabla

Is equivalent to

user_name = blabla

Or even to

us_er-na_me = blabla

When loading options, both underscores and hyphens will be simply discarded. This implementation will allow us renaming options in the .hgrc file without any restrictions and/or backward compatibility issues.

2.2. Proposal: use - or _ in config examples

While major options can be written in only one word, we should start using hyphens or underscores between words.

People who think that backgroundcloseminfilecount, graphnodetemplate, mergemarkertemplate are actually readable should consider stop programming.

2.3. Problems

Only options like post-<command> must not be mangled by the process of removing extraneous -_ characters.

What do to with them?

3. Roadmap

  • Implement code to allow extra -_ characters

CategoryDeveloper CategoryNewFeatures

ConfigConsolidationPlan (last edited 2018-03-28 10:44:39 by AntonShestakov)