Commit Graph

2132 Commits

Author SHA1 Message Date
Carlos Martín Nieto
c8e249b032 object: deprecate git_object__size for removal
In #5118 we remove the double-underscore to make it a normally-named public
function. However, this is not an interesting function outside of the library
and it takes up a name for something that could be more useful.

Remove the single-underscore version as we have not done any releases with it.
2019-07-29 11:15:32 +02:00
Edward Thomson
36558513c8 configuration: deprecate git_cvar safely 2019-07-18 13:59:05 +02:00
Patrick Steinhardt
658022c41a configuration: cvar -> configmap
`cvar` is an unhelpful name.  Refactor its usage to `configmap` for more
clarity.
2019-07-18 13:53:41 +02:00
Patrick Steinhardt
b6625a3b6e Merge pull request #5128 from tiennou/fix/docs
More documentation
2019-06-27 10:12:16 +02:00
Etienne Samson
33448b4519 docs: More of it 2019-06-26 15:49:37 +02:00
Etienne Samson
501c51b244 repo: commondir resolution can sometimes fallback to the repodir
For example, https://git-scm.com/docs/gitrepository-layout says:

    info
    Additional information about the repository is recorded in this directory.
    This directory is ignored if $GIT_COMMON_DIR is set
    and "$GIT_COMMON_DIR/info" will be used instead.

So when looking for `info/attributes`, we need to check the commondir first,
or fallback to "our" `info/attributes`.
2019-06-26 14:49:50 +02:00
Etienne Samson
9f723c97f5 docs: fixups 2019-06-26 14:49:37 +02:00
Edward Thomson
2375be4830 tree: return size_t for treebuilder entrycount
We keep the treebuilder entrycount as a `size_t` - return that instead
of downcasting to an `unsigned int`.  Callers who were storing this
value in an `unsigned int` will continue to downcast themselves, so
there should be no behavior change for callers.
2019-06-24 15:00:41 +01:00
Edward Thomson
2c64291887 net: remove unused git_headlist_cb 2019-06-16 17:56:38 +01:00
Edward Thomson
91a300b7f0 attr: rename constants and macros for consistency
Our enumeration values are not generally suffixed with `T`.  Further,
our enumeration names are generally more descriptive.
2019-06-16 13:49:03 +01:00
Patrick Steinhardt
c3bbbcf567 Merge pull request #5117 from libgit2/ethomson/to_from
Change API instances of `fromnoun` to `from_noun` (with an underscore)
2019-06-16 12:30:56 +02:00
Edward Thomson
e45350feab tag: add underscore to from function
The majority of functions are named `from_something` (with an
underscore) instead of `fromsomething`.  Update the tag function for
consistency with the rest of the library.
2019-06-16 00:55:14 +01:00
Edward Thomson
6574cd0076 index: rename frombuffer to from_buffer
The majority of functions are named `from_something` (with an
underscore) instead of `fromsomething`.  Update the index functions for
consistency with the rest of the library.
2019-06-16 00:55:14 +01:00
Edward Thomson
b7791d0426 object: rename git_object__size to git_object_size
We don't use double-underscores in the public API.
2019-06-16 00:23:01 +01:00
Edward Thomson
08f392080c blob: add underscore to from functions
The majority of functions are named `from_something` (with an
underscore) instead of `fromsomething`.  Update the blob functions for
consistency with the rest of the library.
2019-06-16 00:16:49 +01:00
Edward Thomson
5d92e54745 oid: is_zero instead of iszero
The only function that is named `issomething` (without underscore) was
`git_oid_iszero`.  Rename it to `git_oid_is_zero` for consistency with
the rest of the library.
2019-06-16 00:16:47 +01:00
Etienne Samson
764196fffb doc: add missing documentation comments 2019-06-15 16:15:50 +02:00
Etienne Samson
2376fa6c65 indexer: correct missing includes
Docurium seems to choke on this header because it can't see both
git_indexer_progress & git_indexer_progress_cb, let's add the include.
2019-06-15 16:11:56 +02:00
Edward Thomson
c0dd7122da apply: add an options struct initializer 2019-06-14 09:57:01 +01:00
Edward Thomson
0b5ba0d744 Rename opt init functions to options_init
In libgit2 nomenclature, when we need to verb a direct object, we name
a function `git_directobject_verb`.  Thus, if we need to init an options
structure named `git_foo_options`, then the name of the function that
does that should be `git_foo_options_init`.

The previous names of `git_foo_init_options` is close - it _sounds_ as
if it's initializing the options of a `foo`, but in fact
`git_foo_options` is its own noun that should be respected.

Deprecate the old names; they'll now call directly to the new ones.
2019-06-14 09:57:00 +01:00
Edward Thomson
178df697e3 trace: suffix the callbacks with _cb
The trace logging callbacks should match the other callback naming
conventions, using the `_cb` suffix instead of a `_callback` suffix.
2019-06-10 11:37:00 +01:00
Edward Thomson
810cefd93f credentials: suffix the callbacks with _cb
The credential callbacks should match the other callback naming
conventions, using the `_cb` suffix instead of a `_callback` suffix.
2019-06-10 11:37:00 +01:00
Erik Aigner
59647e1ad0 remote: add callback to resolve URLs before connecting
Since libssh2 doesn't read host configuration from the config file,
this callback can be used to hand over URL resolving to the client
without touching the SSH implementation itself.
2019-05-21 14:11:08 +02:00
Erik Aigner
e215f47579 rebase: orig_head and onto accessors
The rebase struct stores fields with information about the current
rebase process, which were not accessible via a public interface.

Accessors for getting the `orig_head` and `onto` branch
names and object ids have been added.
2019-04-21 22:04:08 +02:00
Edward Thomson
675251d168 Merge pull request #5032 from eaigner/checkout-force-safe-docfix
docs: clarify relation of safe and forced checkout strategy
2019-03-28 20:35:17 -07:00
Erik Aigner
bbba4805e7 docs: clarify relation of safe and forced checkout strategy 2019-03-25 20:47:10 +01:00
Edward Thomson
79b26f20a6 Merge pull request #5008 from libgit2/ethomson/remote_completion
remote: Rename git_remote_completion_type to _t
2019-03-02 18:21:47 +00:00
Edward Thomson
2dd5a42941 remote: Rename git_remote_completion_type to _t
For consistency with other "type" enums, rename
git_remote_completion_type to git_remote_completion_t.
2019-02-25 13:17:58 +00:00
Edward Thomson
459ac856d9 odb: provide a free function for custom backends
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.
2019-02-23 18:42:53 +00:00
Edward Thomson
790aae778d odb: rename git_odb_backend_malloc for consistency
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_.
2019-02-23 18:40:43 +00:00
Edward Thomson
ca909da5dd remote: deprecate git_push_transfer_progress
Safely deprecate `git_push_transfer_progress`, forwarding it to the new
`git_push_transfer_progress_cb` name.
2019-02-22 11:26:51 +00:00
Edward Thomson
59001e8305 remote: rename git_push_transfer_progress callback
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`.
2019-02-22 11:25:14 +00:00
Edward Thomson
7506d34c0c indexer: deprecate git_transfer_progress
Safely deprecate `git_transfer_progress` and `git_transfer_progress_cb`
types, forwarding them to the new `git_indexer_progress` and
`git_indexer_progress_cb`.
2019-02-22 11:25:14 +00:00
Edward Thomson
a1ef995dc0 indexer: use git_indexer_progress throughout
Update internal usage of `git_transfer_progress` to
`git_indexer_progreses`.
2019-02-22 11:25:14 +00:00
Edward Thomson
975d6722a5 indexer: rename git_transfer_progress
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`.
2019-02-22 11:25:14 +00:00
Patrick Steinhardt
9eb098d861 Merge pull request #4991 from libgit2/ethomson/inttypes
Remove public 'inttypes.h' header
2019-02-21 11:37:04 +01:00
Edward Thomson
247e6d909a Remove public 'inttypes.h' header
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.
2019-02-21 09:58:15 +00:00
Edward Thomson
e6c6d3bb3d Remove git_time_monotonic
`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.
2019-02-17 22:31:37 +00:00
Dhruva Krishnamurthy
004a339874 Allow bypassing check '.keep' files using libgit2 option 'GIT_OPT_IGNORE_PACK_KEEP_FILE_CHECK' 2019-02-02 07:56:03 -08:00
Edward Thomson
3fe29c4d4c version: 0.28 2019-01-31 19:10:03 +00:00
Etienne Samson
9fd9126ee7 docs: minor changes 2019-01-30 21:19:18 +01:00
Etienne Samson
690e55e002 repo: split git_repository_open_flag_t options documentation inline 2019-01-28 13:05:52 +01:00
Etienne Samson
f6412c26c1 transport: enhance documentation 2019-01-28 13:05:52 +01:00
Etienne Samson
9e4d421edd doc: clarify that git_time_t is seconds from the epoch 2019-01-28 13:05:15 +01:00
Edward Thomson
9f3a5a64b5 deprecation: offer GIT_DEPRECATE_HARD
Users can define `GIT_DEPRECATE_HARD` if they want to remove all
functions that we've "softly" deprecated.
2019-01-25 09:06:50 +00:00
Edward Thomson
09e2ea2fe1 deprecation: provide docurium deprecation note
Add `@deprecated` to the functions that are, so that they'll appear that
way in docurium.
2019-01-25 09:06:50 +00:00
Edward Thomson
53d13fb3e8 deprecation: deprecated stream registration in if guard
`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.
2019-01-25 09:06:50 +00:00
Edward Thomson
a7d0d14fb0 deprecation: move deprecated bits to deprecated.h 2019-01-25 09:06:50 +00:00
Edward Thomson
647dfdb42d git_error: deprecate error values
Replace the `GITERR` values with a `const int` to deprecate error
values.
2019-01-22 22:26:51 +00:00
Edward Thomson
20961b9871 git_error: use full class name in public error API
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.
2019-01-22 22:26:51 +00:00