Commit Graph

2371 Commits

Author SHA1 Message Date
Edward Thomson
8c29885e02 Merge pull request #6076 from libgit2/ethomson/oidarray_dispose
oidarray: introduce `git_oidarray_dispose`
2021-09-27 08:57:03 -04:00
Edward Thomson
0bd132ab82 oidarray: introduce git_oidarray_dispose
Since users are disposing the _contents_ of the oidarray, not freeing
the oidarray itself, the proper cleanup function is
`git_oidarray_dispose`.  Deprecate `git_oidarray_free`.
2021-09-26 18:02:07 -04:00
Edward Thomson
0f4256b8d7 repository: improve hashfile for absolute paths
When `git_repository_hashfile` is handed an absolute path, it determines
whether the path is within the repository's working directory or not.
This is necessary when there is no `as_path` specified.

If the path is within the working directory, then the given path should
be used for attribute lookups (it is the effective `as_path`).  If it is
not within the working directory, then it is _not_ eligible.

Importantly, now we will _never_ pass an absolute path down to attribute
lookup functions.
2021-09-25 14:39:01 +01:00
Edward Thomson
e7437162ff v1.3: update version number 2021-09-22 08:49:24 -04:00
Edward Thomson
a5644b8090 Merge pull request #6068 from libgit2/ethomson/diff_enum
diff: update `GIT_DIFF_IGNORE_BLANK_LINES`
2021-09-22 08:48:17 -04:00
Edward Thomson
1ba7c32709 diff: update GIT_DIFF_IGNORE_BLANK_LINES
`GIT_DIFF_IGNORE_BLANK_LINES` needs to be within a (signed) int, per the
`enum` definition of ISO C.
2021-09-21 20:23:44 -04:00
Edward Thomson
90656858ce filter: use a git_oid in filter options, not a pointer
Using a `git_oid *` in filter options was a mistake; it is a deviation
from our typical pattern, and callers in some languages that GC may need
very special treatment in order to pass both an options structure and a
pointer outside of it.
2021-09-21 11:28:39 -04:00
Edward Thomson
ba01547d4a Merge pull request #6061 from libgit2/ethomson/email
Introduce `git_email_create`; deprecate `git_diff_format_email`
2021-09-20 21:45:10 -04:00
Edward Thomson
1396a9b556 Merge pull request #6020 from lolgear/refactoring/stdint_ifdef_condition_has_been_reverted
Stdint header condition has been reverted.
2021-09-20 12:36:56 -04:00
Edward Thomson
ba3595af0f diff: deprecate diff_format_email
`git_diff_format_email` is deprecated in favor of `git_email_create`.
2021-09-18 08:32:42 -04:00
Edward Thomson
67b1d019a8 email: include renames by default
`git format-patch` includes diffs with rename detection enabled by
default when creating emails.  Match this behavior.
2021-09-18 08:32:41 -04:00
Edward Thomson
323f222f7e email: include binary diffs by default
`git format-patch` includes binary diffs by default when creating
emails.  Match this behavior.
2021-09-18 08:32:41 -04:00
Edward Thomson
6aa3496679 email: introduce git_email_create_from_diff
Introduce a function to create an email from a diff and multiple inputs
about the source of the diff.

Creating an email from a diff requires many more inputs, and should be
discouraged in favor of building directly from a commit, and is thus in
the `sys` namespace.
2021-09-18 08:32:41 -04:00
Edward Thomson
75d4676a64 email: introduce git_email_create_from_commit
Create `git_email_*` which will encapsulate email creation and
application, and `git_email_create_from_commit` in particular, which
creates an email for a single commit.
2021-09-18 08:32:41 -04:00
Edward Thomson
4f24a932f0 Merge pull request #6031 from libgit2/ethomson/extensions
Support custom git extensions
2021-09-14 07:45:50 -04:00
punkymaniac
379c46463c Fix coding style for pointer
Make some syntax change to follow coding style.
2021-09-09 19:49:04 +02:00
lhchavez
62ee779ea4 remote: Mark git_remote_name_is_valid as GIT_EXTERN
This change makes `git_remote_name_is_valid` be part of the public
interface of the library. This is needed for other language bindings to
be able to find this symbol (like in git2go, when linking against
libgit2 dynamically).
2021-09-04 18:02:17 -07:00
Edward Thomson
a24e656a4e common: support custom repository extensions
Allow users to specify additional repository extensions that they want
to support.  For example, callers can specify that they support
`preciousObjects` and then may open repositories that support
`extensions.preciousObjects`.

Similarly, callers may opt out of supporting extensions that the library
itself supports.
2021-09-04 13:00:18 -04:00
Edward Thomson
c811fc361b v1.2: update version information 2021-08-31 00:19:01 -04:00
Edward Thomson
98be5a1142 Merge branch 'cgraph-write' into main 2021-08-30 17:55:47 -04:00
Edward Thomson
34fa631142 commit graph: formatting fixes 2021-08-30 17:55:13 -04:00
Dmitry Lobanov
2bd3c80e7c include: stdint header condition has been reverted. 2021-08-30 11:41:11 +03:00
Edward Thomson
969a056cc5 Merge pull request #6017 from libgit2/ethomson/buf_is_readonly
buf: deprecate public git_buf writing functions
2021-08-29 22:54:01 -04:00
Edward Thomson
b16a36e111 Merge pull request #6011 from libgit2/ethomson/filter_apply
filter: filter drivers stop taking git_buf as user input
2021-08-29 22:53:49 -04:00
Edward Thomson
258115db3e Merge pull request #6016 from libgit2/ethomson/commit_create_cb
Introduce `create_commit_cb`, deprecate `signing_cb`
2021-08-29 22:53:38 -04:00
Edward Thomson
16a2e6676f Merge pull request #6012 from libgit2/ethomson/custom_url
remote: introduce remote_ready_cb, deprecate resolve_url callback
2021-08-29 22:53:28 -04:00
lhchavez
7d9ebdc840 Merge remote-tracking branch 'origin/main' into cgraph-write 2021-08-29 18:50:49 -07:00
Edward Thomson
2998a84ab6 Merge pull request #5841 from J0Nes90/features/checkout-dry-run
Checkout dry-run
2021-08-29 21:49:33 -04:00
Edward Thomson
aebdee8e3d Update include/git2/checkout.h 2021-08-29 21:49:26 -04:00
Edward Thomson
147b659f3b Merge pull request #5405 from lhchavez/multi-pack-index-odb-write
midx: Introduce git_odb_write_multi_pack_index()
2021-08-29 21:40:26 -04:00
Edward Thomson
18293385d0 Merge pull request #5395 from josharian/http-use-eauth
Use error code GIT_EAUTH for authentication failures
2021-08-29 21:40:16 -04:00
Edward Thomson
9937967efd Merge branch 'main' into http-use-eauth 2021-08-29 21:29:14 -04:00
Edward Thomson
d2316d5746 buf: deprecate public git_buf writing functions
A `git_buf` is now a read-only structure as far as callers are
concerned.  This is a mechanism that we can return data to callers
using memory that is owned by the library and can be cleaned up by
callers (using `git_buf_dispose`).

A `git_buf` can no longer be allocated by callers or provided to the
library.
2021-08-29 13:13:03 -04:00
Edward Thomson
5bcef522f3 filter: deprecate apply function 2021-08-29 12:29:23 -04:00
Edward Thomson
7442c000d9 remote: deprecate resolve_url callback
Using a callback to set a resolve_url is not particularly idiomatic.
Deprecate it in favor of the `set_instance_url` and
`set_instance_pushurl` functions which can now be called from the
`git_remote_ready_cb` callback.
2021-08-29 10:39:28 -04:00
Edward Thomson
72df17c659 remote: introduce git_remote_ready_cb
Introduce a new callback that fires when the remote is ready to connect.
2021-08-29 10:39:28 -04:00
Edward Thomson
ef03e15038 rebase: deprecate signing_cb
The signing callback should not be used; instead, callers should provide
a commit_create_cb, perform the signing and commit creation themselves.
2021-08-29 10:16:56 -04:00
Edward Thomson
d3bdf33b58 rebase: introduce git_commit_create_cb
Introduce a new mechanism for `git_rebase_commit` for callers to
customize the experience.  Instead of assuming that we produce the
commit for them, provide a commit creation callback that allows callers
to produce the commit themselves and return the resulting commit id.
2021-08-29 10:16:29 -04:00
Edward Thomson
a9a7bfb506 filter: add docs for git_filter_stream_fn 2021-08-27 15:06:32 -04:00
Edward Thomson
672406773e remote: introduce set_instance_url
Users may want to override the URL on a particular instance of a remote,
instead of updating the configuration.  Previously, users could use a
callback to do this, but this is not particularly idiomatic.
2021-08-27 11:26:49 -04:00
lhchavez
ea285904dc midx: Introduce git_odb_write_multi_pack_index()
This change introduces git_odb_write_multi_pack_index(), which creates a
`multi-pack-index` file from all the `.pack` files that have been loaded
in the ODB.

Fixes: #5399
2021-08-27 04:12:16 -07:00
lhchavez
9d117e3857 midx: Add a way to write multi-pack-index files
This change adds the git_midx_writer_* functions to allow to
write and create `multi-pack-index` files from `.idx`/`.pack` files.

Part of: #5399
2021-08-27 04:10:37 -07:00
lhchavez
e66545e30f Merge remote-tracking branch 'origin/main' into multi-pack-index-write 2021-08-27 04:06:54 -07:00
lhchavez
47c70fc54e Merge remote-tracking branch 'origin/main' into cgraph-write 2021-08-26 05:40:20 -07:00
lhchavez
63f08e4258 Make the defaultable fields defaultable
Also, add `git_commit_graph_writer_options_init`!
2021-08-26 05:29:34 -07:00
Peter Pettersson
2c2cb3f3ec amiga: use ';' as path list separator on AmigaOS
Like on Windows ':' is used for volume names in absolute paths.
2021-08-08 14:35:07 +02:00
Tony De La Nuez
cd460522c5 odb: Implement option for overriding of default odb backend priority
Introduce GIT_OPT_SET_ODB_LOOSE_PRIORITY and GIT_OPT_SET_ODB_PACKED_PRIORITY
to allow overriding the default priority values for the default ODB
backends. Libgit2 has historically assumed that most objects for long-
running operations will be packed, therefore GIT_LOOSE_PRIORITY is
set to 1 by default, and GIT_PACKED_PRIORITY to 2.
When a client allows libgit2 to set the default backends, they can
specify an override for the two priority values in order to change
the order in which each ODB backend is accessed.
2021-07-30 10:29:51 -04:00
Edward Thomson
cc68c19a3a Merge branch 'pr/5861' 2021-07-30 08:56:51 -04:00
Edward Thomson
47dd9f4797 Merge branch 'pr/5940' 2021-07-30 08:52:37 -04:00
Edward Thomson
346f15ba89 status: document GIT_STATUS_OPT_INCLUDE_UNREADABLE
Document `GIT_STATUS_OPT_INCLUDE_UNREADABLE`, and some minor cleanups.
2021-07-30 08:51:43 -04:00