summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-02-11 21:37:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-02-11 21:37:42 (GMT)
commitfcae987e946ff25e055b7cc5b5b9801d682a7baf (patch)
treec44319168b15e2c76f97113b9cd56b2e8d83aae3 /Documentation
parent14f563031d21a26aa28a08f795c6d2c36580a7bf (diff)
parent412cb2ec1302364aba862b183210249c2ca7d44e (diff)
downloadgit-fcae987e946ff25e055b7cc5b5b9801d682a7baf.zip
git-fcae987e946ff25e055b7cc5b5b9801d682a7baf.tar.gz
git-fcae987e946ff25e055b7cc5b5b9801d682a7baf.tar.bz2
Merge branch 'jc/coding-guidelines'
* jc/coding-guidelines: CodingGuidelines: clarify C #include rules
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/CodingGuidelines11
1 files changed, 8 insertions, 3 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 894546d..578d07c 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -328,9 +328,14 @@ For C programs:
- When you come up with an API, document it.
- - The first #include in C files, except in platform specific
- compat/ implementations, should be git-compat-util.h or another
- header file that includes it, such as cache.h or builtin.h.
+ - The first #include in C files, except in platform specific compat/
+ implementations, must be either "git-compat-util.h", "cache.h" or
+ "builtin.h". You do not have to include more than one of these.
+
+ - A C file must directly include the header files that declare the
+ functions and the types it uses, except for the functions and types
+ that are made available to it by including one of the header files
+ it must include by the previous rule.
- If you are planning a new command, consider writing it in shell
or perl first, so that changes in semantics can be easily