]> git.proxmox.com Git - libgit2.git/blob - CONTRIBUTING.md
Merge branch 'cmn/zlib-update' into cmn/update-zlib
[libgit2.git] / CONTRIBUTING.md
1 # Welcome to libgit2!
2
3 We're making it easy to do interesting things with git, and we'd love to have
4 your help.
5
6 ## Licensing
7
8 By contributing to libgit2, you agree to release your contribution under
9 the terms of the license. Except for the `examples` directory, all code
10 is released under the [GPL v2 with linking exception](COPYING).
11
12 The `examples` code is governed by the
13 [CC0 Public Domain Dedication](examples/COPYING), so that you may copy
14 from them into your own application.
15
16 ## Discussion & Chat
17
18 We hang out in the #libgit2 channel on irc.freenode.net.
19
20 Also, feel free to open an
21 [Issue](https://github.com/libgit2/libgit2/issues/new) to start a discussion
22 about any concerns you have. We like to use Issues for that so there is an
23 easily accessible permanent record of the conversation.
24
25 ## Reporting Bugs
26
27 First, know which version of libgit2 your problem is in and include it in
28 your bug report. This can either be a tag (e.g.
29 [v0.17.0](https://github.com/libgit2/libgit2/tree/v0.17.0) ) or a commit
30 SHA (e.g.
31 [01be7863](https://github.com/libgit2/libgit2/commit/01be786319238fd6507a08316d1c265c1a89407f)
32 ). Using [`git describe`](http://git-scm.com/docs/git-describe) is a great
33 way to tell us what version you're working with.
34
35 If you're not running against the latest `development` branch version,
36 please compile and test against that to avoid re-reporting an issue that's
37 already been fixed.
38
39 It's *incredibly* helpful to be able to reproduce the problem. Please
40 include a list of steps, a bit of code, and/or a zipped repository (if
41 possible). Note that some of the libgit2 developers are employees of
42 GitHub, so if your repository is private, find us on IRC and we'll figure
43 out a way to help you.
44
45 ## Pull Requests
46
47 Our work flow is a typical GitHub flow, where contributors fork the
48 [libgit2 repository](https://github.com/libgit2/libgit2), make their changes
49 on branch, and submit a
50 [Pull Request](https://help.github.com/articles/using-pull-requests)
51 (a.k.a. "PR").
52
53 Life will be a lot easier for you (and us) if you follow this pattern
54 (i.e. fork, named branch, submit PR). If you use your fork's `development`
55 branch, things can get messy.
56
57 Please include a nice description of your changes with your PR; if we have
58 to read the whole diff to figure out why you're contributing in the first
59 place, you're less likely to get feedback and have your change merged in.
60
61 If you are working on a particular area then feel free to submit a PR that
62 highlights your work in progress (and flag in the PR title that it's not
63 ready to merge). This will help in getting visibility for your fix, allow
64 others to comment early on the changes and also let others know that you
65 are currently working on something.
66
67 ## Porting Code From Other Open-Source Projects
68
69 `libgit2` is licensed under the terms of the GPL v2 with a linking
70 exception. Any code brought in must be compatible with those terms.
71
72 The most common case is porting code from core Git. Git is a pure GPL
73 project, which means that in order to port code to this project, we need the
74 explicit permission of the author. Check the
75 [`git.git-authors`](https://github.com/libgit2/libgit2/blob/development/git.git-authors)
76 file for authors who have already consented.
77
78 Other licenses have other requirements; check the license of the library
79 you're porting code *from* to see what you need to do. As a general rule,
80 MIT and BSD (3-clause) licenses are typically no problem. Apache 2.0
81 license typically doesn't work due to GPL incompatibility.
82
83 If you are pulling in code from core Git, another project or code you've
84 pulled from a forum / Stack Overflow then please flag this in your PR and
85 also make sure you've given proper credit to the original author in the
86 code snippet.
87
88 ## Style Guide
89
90 The public API of `libgit2` is [ANSI C](http://en.wikipedia.org/wiki/ANSI_C)
91 (a.k.a. C89) compatible. Internally, `libgit2` is written using a portable
92 subset of C99 - in order to compile with GCC, Clang, MSVC, etc., we keep
93 local variable declarations at the tops of blocks only and avoid `//` style
94 comments. Additionally, `libgit2` follows some extra conventions for
95 function and type naming, code formatting, and testing.
96
97 We like to keep the source code consistent and easy to read. Maintaining
98 this takes some discipline, but it's been more than worth it. Take a look
99 at the
100 [conventions file](https://github.com/libgit2/libgit2/blob/development/CONVENTIONS.md).
101
102 ## Starter Projects
103
104 See our [projects list](https://github.com/libgit2/libgit2/blob/development/PROJECTS.md).