summaryrefslogtreecommitdiff
path: root/include/git2
Commit message (Collapse)AuthorAgeFilesLines
* odb: provide a free function for custom backendsethomson/odb_backend_allocationsEdward Thomson2019-02-231-0/+11
| | | | | | | | | | | | Custom backends can allocate memory when reading objects and providing them to libgit2. However, if an error occurs in the custom backend after the memory has been allocated for the custom object but before it's returned to libgit2, the custom backend has no way to free that memory and it must be leaked. Provide a free function that corresponds to the alloc function so that custom backends have an opportunity to free memory before they return an error.
* odb: rename git_odb_backend_malloc for consistencyEdward Thomson2019-02-231-2/+35
| | | | | | | | | | | | The `git_odb_backend_malloc` name is a system function that is provided for custom ODB backends and allows them to allocate memory for an ODB object in the read callback. This is important so that libgit2 can later free the memory used by an ODB object that was read from the custom backend. However, the name _suggests_ that it actually allocates a `git_odb_backend`. It does not; rename it to make it clear that it actually allocates backend _data_.
* remote: deprecate git_push_transfer_progressethomson/transfer_progressEdward Thomson2019-02-221-0/+9
| | | | | Safely deprecate `git_push_transfer_progress`, forwarding it to the new `git_push_transfer_progress_cb` name.
* remote: rename git_push_transfer_progress callbackEdward Thomson2019-02-221-2/+3
| | | | | | The `git_push_transfer_progress` is a callback and as such should be suffixed with `_cb` for consistency. Rename `git_push_transfer_progress` to `git_push_transfer_progress_cb`.
* indexer: deprecate git_transfer_progressEdward Thomson2019-02-222-4/+29
| | | | | | Safely deprecate `git_transfer_progress` and `git_transfer_progress_cb` types, forwarding them to the new `git_indexer_progress` and `git_indexer_progress_cb`.
* indexer: use git_indexer_progress throughoutEdward Thomson2019-02-227-12/+12
| | | | | Update internal usage of `git_transfer_progress` to `git_indexer_progreses`.
* indexer: rename git_transfer_progressEdward Thomson2019-02-222-30/+45
| | | | | | | | | | The name `git_transfer_progress` does not reflect its true purpose. It suggests that it's progress for a non-existence `git_transfer` object, and is used for indexing callbacks more broadly than just during transfers. Rename `git_transfer_progress` to `git_indexer_progress`.
* Merge pull request #4991 from libgit2/ethomson/inttypesPatrick Steinhardt2019-02-212-313/+1
|\ | | | | Remove public 'inttypes.h' header
| * Remove public 'inttypes.h' headerethomson/inttypesEdward Thomson2019-02-212-313/+1
| | | | | | | | | | | | | | | | | | | | | | Remove an `inttypes.h` header that is too large in scope, and far too public. For Visual Studio 2012 and earlier (ie, `_MSC_VER < 1800`), we do need to include `stdint.h` in our public headers, for types like `uint32_t`. Internally, we also need to define `PRId64` as a printf formatting string when it is not available.
* | Remove `git_time_monotonic`remove_time_monotonicEdward Thomson2019-02-171-31/+0
|/ | | | | | | | | | `git_time_monotonic` was added so that non-native bindings like rugged could get high-resolution timing for benchmarking. However, this is outside the scope of libgit2 *and* rugged decided not to use this function in the first place. Google suggests that absolutely _nobody_ is using this function and we don't want to be in the benchmarking business. Remove the function.
* Allow bypassing check '.keep' files using libgit2 option ↵Dhruva Krishnamurthy2019-02-021-1/+6
| | | | 'GIT_OPT_IGNORE_PACK_KEEP_FILE_CHECK'
* version: 0.28ethomson/0_28Edward Thomson2019-01-311-3/+3
|
* docs: minor changesEtienne Samson2019-01-301-12/+21
|
* repo: split git_repository_open_flag_t options documentation inlineEtienne Samson2019-01-281-28/+41
|
* transport: enhance documentationEtienne Samson2019-01-281-57/+88
|
* doc: clarify that git_time_t is seconds from the epochEtienne Samson2019-01-282-3/+3
|
* deprecation: offer GIT_DEPRECATE_HARDEdward Thomson2019-01-251-0/+7
| | | | | Users can define `GIT_DEPRECATE_HARD` if they want to remove all functions that we've "softly" deprecated.
* deprecation: provide docurium deprecation noteEdward Thomson2019-01-251-0/+5
| | | | | Add `@deprecated` to the functions that are, so that they'll appear that way in docurium.
* deprecation: deprecated stream registration in if guardEdward Thomson2019-01-251-6/+15
| | | | | | | | `git_stream_register_tls` is now deprecated; mark it in an if guard with the deprecation. This should not be included in `deprecated.h` since it is an uncommonly used `sys` header file.
* deprecation: move deprecated bits to deprecated.hEdward Thomson2019-01-256-210/+241
|
* git_error: deprecate error valuesEdward Thomson2019-01-221-34/+34
| | | | | Replace the `GITERR` values with a `const int` to deprecate error values.
* git_error: use full class name in public error APIEdward Thomson2019-01-227-54/+142
| | | | | | | | | Move to the `git_error` name in error-related functions, deprecating the `giterr` functions. This means, for example, that `giterr_last` is now `git_error_last`. The old names are retained for compatibility. This only updates the public API; internal API and function usage remains unchanged.
* deprecation: use the enum type in declarationEdward Thomson2019-01-202-19/+19
| | | | | | | | | | | | | | The C standard does not specify whether an enum is a signed or unsigned type. Obviously, any enum that includes negative values _must_ be signed, but if all values are positive then the compiler is free to choose signed or unsigned. Thus, by changing the type signatures to `git_object_t` and declaring the old `GIT_OBJ_` values as a signed or unsigned int, we risk a mismatch between what the compiler has chosen for a `git_object_t`'s type and our type declaration. Thus, we declare the deprecated values as the enum instead of guessing.
* deprecation: add `used` attributeEdward Thomson2019-01-201-0/+1
| | | | | Recent GCC enables `-Wunused-const-variables`, which makes output quite noisy. Disable unused warnings for our deprecated variables.
* Merge pull request #4939 from libgit2/ethomson/git_refEdward Thomson2019-01-192-13/+47
|\ | | | | Move `git_ref_t` to `git_reference_t`
| * references: use full name in type namesEdward Thomson2019-01-172-13/+47
| | | | | | | | | | | | | | | | | | Update the reference type names from an abbreviation (`git_ref`) to use the fullname (`git_reference`). This ensures that we are consistent with our naming for reference types and functions throughout the library. The previous names are now marked as deprecated.
* | Merge pull request #4940 from libgit2/ethomson/git_objEdward Thomson2019-01-191-11/+11
|\ \ | | | | | | More `git_obj` to `git_object` updates
| * | object_type: GIT_OBJECT_BAD is now GIT_OBJECT_INVALIDEdward Thomson2019-01-171-2/+2
| | | | | | | | | | | | | | | | | | | | | We use the term "invalid" to refer to bad or malformed data, eg `GIT_REF_INVALID` and `GIT_EINVALIDSPEC`. Since we're changing the names of the `git_object_t`s in this release, update it to be `GIT_OBJECT_INVALID` instead of `BAD`.
| * | object_type: mark old values as deprecatedEdward Thomson2019-01-171-10/+10
| |/ | | | | | | | | Mark old object type values as `static const` so that we can mark them as deprecated with the `GIT_DEPRECATED` macro.
* | Introduce GIT_CALLBACK macro to enforce cdeclEdward Thomson2019-01-1734-155/+162
| | | | | | | | | | | | | | | | | | Since we now always build the library with cdecl calling conventions, our callbacks should be decorated as such so that users will not be able to provide callbacks defined with other calling conventions. The `GIT_CALLBACK` macro will inject the `__cdecl` attribute as appropriate.
* | Use cdecl calling conventions on Win32Edward Thomson2019-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recommendation from engineers within Microsoft is that libraries should have a calling convention specified in the public API, and that calling convention should be cdecl unless there are strong reasons to use a different calling convention. We previously offered end-users the choice between cdecl and stdcall calling conventions. We did this for presumed wider compatibility: most Windows applications will use cdecl, but C# and PInvoke default to stdcall for WINAPI compatibility. (On Windows, the standard library functions are are stdcall so PInvoke also defaults to stdcall.) However, C# and PInvoke can easily call cdecl APIs by specifying an annotation. Thus, we will explicitly declare ourselves cdecl and remove the option to build as stdcall.
* | buffer: wrap EXTERN in DEPRECATEDEdward Thomson2019-01-171-1/+1
|/ | | | | The GIT_EXTERN macro needs to provide order-specific attributes; update users of the GIT_DEPRECATED macro to allow for that.
* refs: constify git_reference_peelCarlos Martín Nieto2018-12-141-1/+1
| | | | | | | We have no need to take a non-const reference. This does involve some other work to make sure we don't mix const and non-const variables, but by splitting what we want each variable to do we can also simplify the logic for when we do want to free a new reference we might have allocated.
* object_type: update public API to use git_object_tEdward Thomson2018-12-018-42/+42
| | | | | | git_object_t is the future; update the public API to use it. This will also ensure that we can build our tests which make use of the old API without modification (and without compiler warnings).
* object_type: remove unused object type flagsEdward Thomson2018-12-011-2/+0
| | | | | | | | | | | | The two "reserved" bits in `git_object_t` are unused. They were included for completeness, but downstream users should never use them and they should not have been made public. These values are never set. With the refactoring of `git_otype` into `git_object_t`, we can remove these from the new API. They will remain in the old (deprecated) API in the unlikely event that someone was using them.
* object_type: update enumeration namesEdward Thomson2018-12-011-11/+35
| | | | | | | | | Update the `git_otype` names to reflect our current naming conventions. `git_otype` is now `git_object_t` and the `GIT_OBJ_*` values are now `GIT_OBJECT_*` values. The old macro, enumeration and structure names are retained and simply set to the new names.
* index: update enum and structure namesEdward Thomson2018-12-011-42/+74
| | | | | | | | | | | We have various macro, enumeration and structure names that were introduced (very) early in the project and do not match our current naming conventions. For instance: `GIT_IDXENTRY...` flags that correspond to a structure named `git_index_entry`. Update these to match the current guidance. The old macros and enumeration names are reflected as new macros in order to support backward compatibility (and do so without warnings for consumers).
* Merge pull request #4770 from tiennou/feature/merge-analysis-any-branchPatrick Steinhardt2018-11-301-0/+19
|\ | | | | Allow merge analysis against any reference
| * merge: make analysis possible against a non-HEAD referenceEtienne Samson2018-10-191-0/+19
| | | | | | | | | | | | | | This moves the current merge analysis code into a more generic version that can work against any reference. Also change the tests to check returned analysis values exactly.
* | Merge pull request #4888 from TheBB/add-cbPatrick Steinhardt2018-11-291-1/+1
|\ \ | | | | | | revwalk: Allow changing hide_cb
| * | revwalk: Allow changing hide_cbEivind Fonn2018-11-281-1/+1
| | | | | | | | | | | | | | | Since git_revwalk objects are encouraged to be reused, a public interface for changing hide_cb is desirable.
* | | stream registration: take an enum typeEdward Thomson2018-11-281-3/+15
| | | | | | | | | | | | | | | | | | Accept an enum (`git_stream_t`) during custom stream registration that indicates whether the registration structure should be used for standard (non-TLS) streams or TLS streams.
* | | stream: provide generic registration APIEdward Thomson2018-11-281-9/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | Update the new stream registration API to be `git_stream_register` which takes a registration structure and a TLS boolean. This allows callers to register non-TLS streams as well as TLS streams. Provide `git_stream_register_tls` that takes just the init callback for backward compatibliity.
* | | tls: introduce a wrap functionEdward Thomson2018-11-281-6/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce `git_tls_stream_wrap` which will take an existing `stream` with an already connected socket and begin speaking TLS on top of it. This is useful if you've built a connection to a proxy server and you wish to begin CONNECT over it to tunnel a TLS connection. Also update the pluggable TLS stream layer so that it can accept a registration structure that provides an `init` and `wrap` function, instead of a single initialization function.
* | | Merge pull request #4879 from libgit2/ethomson/defer_cert_cred_cbPatrick Steinhardt2018-11-283-3/+12
|\ \ \ | | | | | | | | Allow certificate and credential callbacks to decline to act
| * | | transport: allow cred/cert callbacks to return GIT_PASSTHROUGHethomson/defer_cert_cred_cbEdward Thomson2018-11-212-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow credential and certificate checking callbacks to return GIT_PASSTHROUGH, indicating that they do not want to act. Introduce this to support in both the http and ssh callbacks. Additionally, enable the same mechanism for certificate validation. This is most useful to disambiguate any meaning in the publicly exposed credential and certificate functions (`git_transport_smart_credentials` and `git_transport_smart_certificate_check`) but it may be more generally useful for callers to be able to defer back to libgit2.
| * | | transport: see if cert/cred callbacks exist before calling themEdward Thomson2018-11-151-2/+8
| |/ / | | | | | | | | | | | | | | | | | | Custom transports may want to ask libgit2 to invoke a configured credential or certificate callback; however they likely do not know if a callback was actually configured. Return a sentinal value (GIT_PASSTHROUGH) if there is no callback configured instead of crashing.
* | | Merge pull request #4884 from libgit2/ethomson/index_iteratorPatrick Steinhardt2018-11-212-0/+43
|\ \ \ | | | | | | | | index: introduce git_index_iterator
| * | | index: introduce git_index_iteratorethomson/index_iteratorEdward Thomson2018-11-142-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | Provide a public git_index_iterator API that is backed by an index snapshot. This allows consumers to provide a stable iteration even while manipulating the index during iteration.
* | | | worktree: Expose git_worktree_add_init_optionsOzan Sener2018-11-181-1/+1
| |/ / |/| |