aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/CodingGuidelines
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/CodingGuidelines')
-rw-r--r--Documentation/CodingGuidelines21
1 files changed, 19 insertions, 2 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index ba047ed224..6350949f2e 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -44,7 +44,7 @@ code are expected to match the style the surrounding code already
uses (even if it doesn't match the overall style of existing code).
But if you must have a list of rules, here are some language
-specific ones. Note that Documentation/ToolsForGit.txt document
+specific ones. Note that Documentation/ToolsForGit.adoc document
has a collection of tips to help you use some external tools
to conform to these guidelines.
@@ -315,6 +315,9 @@ For C programs:
encouraged to have a blank line between the end of the declarations
and the first statement in the block.
+ - Do not explicitly initialize global variables to 0 or NULL;
+ instead, let BSS take care of the zero initialization.
+
- NULL pointers shall be written as NULL, not as 0.
- When declaring pointers, the star sides with the variable
@@ -755,7 +758,7 @@ Externally Visible Names
Writing Documentation:
Most (if not all) of the documentation pages are written in the
- AsciiDoc format in *.txt files (e.g. Documentation/git.txt), and
+ AsciiDoc format in *.adoc files (e.g. Documentation/git.adoc), and
processed into HTML and manpages (e.g. git.html and git.1 in the
same directory).
@@ -861,6 +864,9 @@ Markup:
_<git-dir>_
_<key-id>_
+Characters are also surrounded by underscores:
+ _LF_, _CR_, _CR_/_LF_, _NUL_, _EOF_
+
Git's Asciidoc processor has been tailored to treat backticked text
as complex synopsis. When literal and placeholders are mixed, you can
use the backtick notation which will take care of correctly typesetting
@@ -874,6 +880,17 @@ Markup:
As a side effect, backquoted placeholders are correctly typeset, but
this style is not recommended.
+ When documenting multiple related `git config` variables, place them on
+ a separate line instead of separating them by commas. For example, do
+ not write this:
+ `core.var1`, `core.var2`::
+ Description common to `core.var1` and `core.var2`.
+
+Instead write this:
+ `core.var1`::
+ `core.var2`::
+ Description common to `core.var1` and `core.var2`.
+
Synopsis Syntax
The synopsis (a paragraph with [synopsis] attribute) is automatically