Skip to content

Commit

Permalink
CodingGuidelines: describe naming rules for configuration variables
Browse files Browse the repository at this point in the history
We may want to say something about command line option names in the
new section as well, but for now, let's make sure everybody is clear
on how to structure and name their configuration variables.

The text for the rules are partly taken from the log message of
Jonathan's 6b3020a (add: introduce add.ignoreerrors synonym for
add.ignore-errors, 2010-12-01).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Feb 2, 2015
1 parent 502e7f9 commit 35840a3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Documentation/CodingGuidelines
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,29 @@ Error Messages
- Say what the error is first ("cannot open %s", not "%s: cannot open")


Externally Visible Names

- For configuration variable names, follow the existing convention:

. The section name indicates the affected subsystem.

. The subsection name, if any, indicates which of an unbounded set
of things to set the value for.

. The variable name describes the effect of tweaking this knob.

The section and variable names that consist of multiple words are
formed by concatenating the words without punctuations (e.g. `-`),
and are broken using bumpyCaps in documentation as a hint to the
reader.

When choosing the variable namespace, do not use variable name for
specifying possibly unbounded set of things, most notably anything
an end user can freely come up with (e.g. branch names). Instead,
use subsection names or variable values, like the existing variable
branch.<name>.description does.


Writing Documentation:

Most (if not all) of the documentation pages are written in the
Expand Down

0 comments on commit 35840a3

Please sign in to comment.