summaryrefslogtreecommitdiff
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-02-20 11:26:51 -0800
committerRussell Belfer <rb@github.com>2014-02-20 11:26:51 -0800
commit68a19ca9ffb685123038a8d16c0a59845f147778 (patch)
tree6fc61ee4886564670fc45f32a7d7f62f1712ff4d /CONTRIBUTING.md
parent978a4ed5ebd3892731434e4023f20383f820c112 (diff)
downloadlibgit2-68a19ca9ffb685123038a8d16c0a59845f147778.tar.gz
Clarify C compatibility policy
and a couple of other minor doc fixups.
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md26
1 files changed, 17 insertions, 9 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 807cd5320..0ae75c7ce 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -5,9 +5,13 @@ your help.
## Licensing
-By contributing to libgit2, you agree to release your contribution under the terms of the license.
-For code under `examples`, this is governed by the [CC0 Public Domain Dedication](examples/COPYING).
-All other code is released under the [GPL v2 with linking exception](COPYING).
+By contributing to libgit2, you agree to release your contribution under
+the terms of the license. Except for the `examples` directory, all code
+is released under the [GPL v2 with linking exception](COPYING).
+
+The `examples` code is governed by the
+[CC0 Public Domain Dedication](examples/COPYING), so that you may copy
+from them into your own application.
## Discussion & Chat
@@ -76,15 +80,19 @@ you're porting code *from* to see what you need to do. As a general rule,
MIT and BSD (3-clause) licenses are typically no problem. Apache 2.0
license typically doesn't work due to GPL incompatibility.
-If you are pulling in code from core Git, another project or code you've pulled from
-a forum / Stack Overflow then please flag this in your PR and also make sure you've
-given proper credit to the original author in the code snippet.
+If you are pulling in code from core Git, another project or code you've
+pulled from a forum / Stack Overflow then please flag this in your PR and
+also make sure you've given proper credit to the original author in the
+code snippet.
## Style Guide
-`libgit2` is written in [ANSI C](http://en.wikipedia.org/wiki/ANSI_C)
-(a.k.a. C89) with some specific conventions for function and type naming,
-code formatting, and testing.
+The public API of `libgit2` is [ANSI C](http://en.wikipedia.org/wiki/ANSI_C)
+(a.k.a. C89) compatible. Internally, `libgit2` is written using a portable
+subset of C99 - in order to compiler with GCC, Clang, MSVC, etc., we keep
+local variable declarations at the tops of blocks only and avoid `//` style
+comments. Additionally, `libgit2` follows some extra conventions for
+function and type naming, code formatting, and testing.
We like to keep the source code consistent and easy to read. Maintaining
this takes some discipline, but it's been more than worth it. Take a look