summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-01-27 20:26:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-02-02 19:28:55 (GMT)
commit35840a3e789dd67528caefc146deb698bd6ac7a5 (patch)
treec928cfb199de89df53cc5cbb8b017cd37b314dcc /Documentation
parent502e7f9851768974a5b45a9dc00882231dac5c90 (diff)
downloadgit-35840a3e789dd67528caefc146deb698bd6ac7a5.zip
git-35840a3e789dd67528caefc146deb698bd6ac7a5.tar.gz
git-35840a3e789dd67528caefc146deb698bd6ac7a5.tar.bz2
CodingGuidelines: describe naming rules for configuration variables
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 6b3020a2 (add: introduce add.ignoreerrors synonym for add.ignore-errors, 2010-12-01). Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/CodingGuidelines23
1 files changed, 23 insertions, 0 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 894546d..0f8cccf 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -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