3 We're making it easy to do interesting things with git, and we'd love to have
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).
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.
18 We hang out in the #libgit2 channel on irc.freenode.net.
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.
27 The `master` branch is the main branch where development happens.
29 (e.g. [v0.21.0](https://github.com/libgit2/libgit2/releases/tag/v0.21.0) )
30 and when a critical bug fix needs to be backported, it will be done on a
31 `<tag>-maint` maintenance branch.
35 First, know which version of libgit2 your problem is in and include it in
36 your bug report. This can either be a tag (e.g.
37 [v0.17.0](https://github.com/libgit2/libgit2/releases/tag/v0.17.0) ) or a
39 [01be7863](https://github.com/libgit2/libgit2/commit/01be786319238fd6507a08316d1c265c1a89407f)
40 ). Using [`git describe`](http://git-scm.com/docs/git-describe) is a
41 great way to tell us what version you're working with.
43 If you're not running against the latest `master` branch version,
44 please compile and test against that to avoid re-reporting an issue that's
47 It's *incredibly* helpful to be able to reproduce the problem. Please
48 include a list of steps, a bit of code, and/or a zipped repository (if
49 possible). Note that some of the libgit2 developers are employees of
50 GitHub, so if your repository is private, find us on IRC and we'll figure
51 out a way to help you.
55 Our work flow is a [typical GitHub flow](https://guides.github.com/introduction/flow/index.html),
56 where contributors fork the [libgit2 repository](https://github.com/libgit2/libgit2),
57 make their changes on branch, and submit a
58 [Pull Request](https://help.github.com/articles/using-pull-requests) (a.k.a. "PR").
59 Pull requests should usually be targeted at the `master` branch.
61 Life will be a lot easier for you (and us) if you follow this pattern
62 (i.e. fork, named branch, submit PR). If you use your fork's `master`
63 branch directly, things can get messy.
65 Please include a nice description of your changes when you submit your PR;
66 if we have to read the whole diff to figure out why you're contributing
67 in the first place, you're less likely to get feedback and have your change
70 If you are starting to work on a particular area, feel free to submit a PR
71 that highlights your work in progress (and note in the PR title that it's
72 not ready to merge). These early PRs are welcome and will help in getting
73 visibility for your fix, allow others to comment early on the changes and
74 also let others know that you are currently working on something.
76 Before wrapping up a PR, you should be sure to:
78 * Write tests to cover any functional changes (ideally tests that would
79 have failed before the PR and now pass)
80 * Update documentation for any changed public APIs
81 * Add to the [`CHANGELOG.md`](CHANGELOG.md) file describing any major changes
83 ## Porting Code From Other Open-Source Projects
85 `libgit2` is licensed under the terms of the GPL v2 with a linking
86 exception. Any code brought in must be compatible with those terms.
88 The most common case is porting code from core Git. Git is a pure GPL
89 project, which means that in order to port code to this project, we need the
90 explicit permission of the author. Check the
91 [`git.git-authors`](https://github.com/libgit2/libgit2/blob/development/git.git-authors)
92 file for authors who have already consented.
94 Other licenses have other requirements; check the license of the library
95 you're porting code *from* to see what you need to do. As a general rule,
96 MIT and BSD (3-clause) licenses are typically no problem. Apache 2.0
97 license typically doesn't work due to GPL incompatibility.
99 If your pull request uses code from core Git, another project, or code
100 from a forum / Stack Overflow, then *please* flag this in your PR and make
101 sure you've given proper credit to the original author in the code
106 The public API of `libgit2` is [ANSI C](http://en.wikipedia.org/wiki/ANSI_C)
107 (a.k.a. C89) compatible. Internally, `libgit2` is written using a portable
108 subset of C99 - in order to compile with GCC, Clang, MSVC, etc., we keep
109 local variable declarations at the tops of blocks only and avoid `//` style
110 comments. Additionally, `libgit2` follows some extra conventions for
111 function and type naming, code formatting, and testing.
113 We like to keep the source code consistent and easy to read. Maintaining
114 this takes some discipline, but it's been more than worth it. Take a look
116 [conventions file](https://github.com/libgit2/libgit2/blob/development/CONVENTIONS.md).
120 See our [projects list](https://github.com/libgit2/libgit2/blob/development/PROJECTS.md).