| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|/ |
|
|
|
|
|
| |
Replace the `GITERR` values with a `const int` to deprecate error
values.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Recent GCC enables `-Wunused-const-variables`, which makes output quite
noisy. Disable unused warnings for our deprecated variables.
|
|\
| |
| | |
Move `git_ref_t` to `git_reference_t`
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | | |
More `git_obj` to `git_object` updates
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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`.
|
| |/
| |
| |
| |
| | |
Mark old object type values as `static const` so that we can mark them
as deprecated with the `GIT_DEPRECATED` macro.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
|
| |
The GIT_EXTERN macro needs to provide order-specific attributes; update
users of the GIT_DEPRECATED macro to allow for that.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|\
| |
| | |
Allow merge analysis against any reference
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | | |
revwalk: Allow changing hide_cb
|
| | |
| | |
| | |
| | |
| | | |
Since git_revwalk objects are encouraged to be reused, a public
interface for changing hide_cb is desirable.
|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
Allow certificate and credential callbacks to decline to act
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
index: introduce git_index_iterator
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| |/ /
|/| | |
|
|\ \ \
| |/ /
|/| | |
Remote creation API
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
This supersedes the functionality of remote_create_with_fetchspec, remote_create_anonymous and remote_create_detached.
|
| | |
| | |
| | |
| | |
| | | |
Introduce a callback to patch application that allows consumers to
cancel hunk application.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Introduce a callback to the application options that allow callers to
add a per-delta callback. The callback can return an error code to stop
patch application, or can return a value to skip the application of a
particular delta.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Move the location option to an argument, out of the options structure.
This allows the options structure to be re-used for functions that don't
need to know the location, since it's implicit in their functionality.
For example, `git_apply_tree` should not take a location, but is
expected to take all the other options.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Return `GIT_EAPPLYFAIL` on patch application failure so that users can
determine that patch application failed due to a malformed/conflicting
patch by looking at the error code.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Introduce `git_apply`, which will take a `git_diff` and apply it to the
working directory (akin to `git apply`), the index (akin to `git apply
--cached`), or both (akin to `git apply --index`).
|
|/ /
| |
| |
| |
| | |
Introduce `git_apply_tree`, which will apply a `git_diff` to a given
`git_tree`, allowing an in-memory patch application for a repository.
|
| |
| |
| |
| |
| | |
Provide a utility to reset custom allocators back to their default.
This is particularly useful for testing.
|
|/
|
|
|
|
|
|
| |
These checks are preformed by libgit2 on checkout, but they're also useful for
performing checks in applications which do not involve checkout.
Expose them under `sys/` as it's still fairly in the weeds even for this
library.
|
|
|
| |
The underlying code uses GIT_CONFIG_FILENAME_GLOBAL, which is .gitconfig.
|
| |
|
|
|
|
|
| |
Show more directly what the sorting modes correspond to in git's `rev-list` as
that's the reference implementation for what the possible sorting orders are.
|
|\
| |
| | |
Documentation fixes
|
| | |
|
| | |
|
| | |
|