|
| 1 | +The maintainers of the libgit2 project believe that having a stable API |
| 2 | +to program against is important for our users and the ecosystem - whether |
| 3 | +you're building against the libgit2 C APIs directly, creating a wrapper to |
| 4 | +a managed language, or programming against one of those managed wrappers |
| 5 | +like LibGit2Sharp or Rugged. |
| 6 | + |
| 7 | +Our API stability considerations are: |
| 8 | + |
| 9 | +* Our standard API is considered stable through a major release. |
| 10 | + |
| 11 | + * We define our "standard API" to be anything included in the "git2.h" |
| 12 | + header - in other words, anything defined in a header in the `git2` |
| 13 | + directory. |
| 14 | + |
| 15 | + * APIs will maintain their signature and will not be removed within a |
| 16 | + major release, but new APIs may be added. |
| 17 | + |
| 18 | + * Any APIs may be marked as deprecated within a major release, but will |
| 19 | + not be removed until the next major release (at the earliest). You |
| 20 | + may define `GIT_DEPRECATE_HARD` to produce compiler warnings if you |
| 21 | + target these deprecated APIs. |
| 22 | + |
| 23 | + * We consider API compatibility to be against the C APIs. That means |
| 24 | + that we may use macros to keep API compatibility - for example, if we |
| 25 | + rename a structure from `git_widget_options` to `git_foobar_options` |
| 26 | + then we would `#define git_widget_options git_foobar_options` to retain |
| 27 | + API compatibility. Note that this does _not_ provide ABI compatibility. |
| 28 | + |
| 29 | +* Our systems API is only considered stable through a _minor_ release. |
| 30 | + |
| 31 | + * We define our "systems API" to be anything included in the `git2/sys` |
| 32 | + directory. These are not "standard" APIs but are mechanisms to extend |
| 33 | + libgit2 by adding new extensions - for example, a custom HTTPS transport, |
| 34 | + TLS engine, or merge strategy. |
| 35 | + |
| 36 | + * Additionally, the cmake options and the resulting constants that it |
| 37 | + produces to be "systems API". |
| 38 | + |
| 39 | + * Generally these mechanism are well defined and will not need significant |
| 40 | + changes, but are considered a part of the library itself and may need |
| 41 | + |
| 42 | + * Systems API changes will be noted specially within a release's changelog. |
| 43 | + |
| 44 | +* Our ABI is only considered stable through a _minor_ release. |
| 45 | + |
| 46 | + * Our ABI consists of actual symbol names in the library, the function |
| 47 | + signatures, and the actual layout of structures. These are only |
| 48 | + stable within minor releases, they are not stable within major releases |
| 49 | + (yet). |
| 50 | + |
| 51 | + * Since many FFIs use ABIs directly (for example, .NET P/Invoke or Rust), |
| 52 | + this instability is unfortunate. |
| 53 | + |
| 54 | + * In a future major release, we will begin providing ABI stability |
| 55 | + throughout the major release cycle. |
| 56 | + |
| 57 | + * ABI changes will be noted specially within a release's changelog. |
| 58 | + |
| 59 | +* Point releases are _generally_ only for bugfixes, and generally do _not_ |
| 60 | + include new features. This means that point releases generally do _not_ |
| 61 | + include new APIs. Point releases will never break API, systems API or |
| 62 | + ABI compatibility. |
| 63 | + |
0 commit comments