Commit Graph

2424 Commits

Author SHA1 Message Date
Edward Thomson
b3e2303098 huh 2023-04-11 21:50:32 +01:00
Edward Thomson
9d1a3ef7c7 v1.6.2: update version numbers 2023-02-28 10:18:00 +00:00
Edward Thomson
8a871d13b7 v1.6.1: correct missing version number updates 2023-02-25 13:53:43 +00:00
Edward Thomson
ef235a1662 v1.6: update version numbers 2023-02-24 22:21:41 +00:00
Tim Rogers
86b532de15 Correct the definition of "empty" in the docs for git_repository_is_empty
This improves the documentation for `git_repository_is_empty`
which currently does not accurately describe libgit2's definition
of "empty".

It says that HEAD must point to the "unborn master branch", when
in fact, this is not the case if the repo's `init.defaultBranch`
configuration is set. If it is set, it will check that HEAD points
there. Only if it is not set does it fall back to `master`.
2023-02-23 18:47:03 +00:00
Edward Thomson
d16b59c91e odb: don't unconditionally add oid_type to stream
`git_odb_stream` should have an `oid_type` to disambiguate; that's not
necessary on non-experimental SHA256 builds. Avoid unnecessary ABI
breakage for consumers and hide it behind an ifdef for now.
2023-02-23 14:03:16 +00:00
Edward Thomson
05ba3fe4e1 Merge pull request #6330 from gitkraken-jacobw/partial-stashing
stash: partial stash specific files
2023-02-16 10:23:28 +00:00
Edward Thomson
7c6df9e125 strarray: remove deprecated declaration
`git_strarray_copy` is deprecated (and has been included in
`deprecated.h` for some time). It should not have remained in
the public `strarray.h`. Remove it.
2023-02-16 09:49:27 +00:00
Edward Thomson
35580d88a8 stash: fixes from code review 2023-02-16 09:11:57 +00:00
Edward Thomson
80742e159c Merge pull request #6456 from libgit2/ethomson/sha256_experimental
SHA256: more SHA256 support
2023-02-14 17:01:23 +00:00
Edward Thomson
8eadeedee4 repo: take an oid_type when initializing 2023-02-12 22:02:00 +00:00
Edward Thomson
53fcd5b8f5 transport: teach transports about oid types and SHA256 2023-02-12 22:02:00 +00:00
Edward Thomson
fe2ee3a018 object: lookup sha256 objects
This is much of the plumbing for the object database to support SHA256,
and for objects to be able to parse SHA256 versions of themselves.
2023-02-12 22:02:00 +00:00
Edward Thomson
479c8c8c14 packfile: handle sha256 packfiles
Teach the packfile machinery to cope with SHA256.
2023-02-12 21:26:12 +00:00
Edward Thomson
acb00e4eae repo: understand the objectformat extension
Teach the repository about the `objectformat` extension, supporting
`sha1` always and `sha256` when the experimental sha256 support is
active.
2023-02-12 21:26:10 +00:00
Edward Thomson
894543827d core: allow users to configure home directory
Some callers -- like our test suite and the test suites of our language
bindings -- want to isolate the home directory to avoid accidentally
including the executing user's actual home directory data.

Previously, we combined the notion of a home directory and global
configuration -- now that this is separated, we provide users the
ability to configure both.
2023-02-09 12:10:40 +00:00
Edward Thomson
c11724686c cmake: provide empty experimental.h for non-cmake users
Not everybody builds libgit2 using cmake; provide an `experimental.h`
with no experiments configured for those that do not. To support this,
we also now create compile definitions for experimental functionality,
to supplant that empty `experimental.h`. cmake will continue to generate
the proper `experimental.h` file for use with `make install`.
2022-09-19 06:34:51 -04:00
Jacob Watson
fc9d28970a stash: add const to arguments 2022-07-14 10:24:00 -07:00
Jacob Watson
8dc78a0f62 stash: implement partial stashing by path 2022-07-14 10:20:20 -07:00
Edward Thomson
b43567d655 sha256: indirection for experimental functions
The experimental function signature is only available when
`GIT_EXPERIMENTAL_SHA256` is enabled.
2022-07-13 22:50:33 -04:00
Edward Thomson
433a133402 Merge pull request #6191 from libgit2/ethomson/sha256_poc
RFC: SHA256 proof of concept
2022-07-13 21:08:04 -04:00
Edward Thomson
43dd3700a2 meta: update version number to v1.6.0-alpha 2022-07-13 20:19:35 -04:00
Edward Thomson
2be53a5da7 v1.5: update version numbers 2022-07-13 12:50:01 -04:00
Edward Thomson
6c57bac6b1 sha256: make sha256 an experimental optional feature
libgit2 can be built with optional, experimental sha256 support. This
allows consumers to begin testing and providing feedback for our sha256
support while we continue to develop it, and allows us to make API
breaking changes while we iterate on a final sha256 implementation.

The results will be `git2-experimental.dll` and installed as
`git2-experimental.h` to avoid confusion with a production libgit2.
2022-06-20 17:12:49 -04:00
Edward Thomson
04f34688c4 odb_loose: SHA256 support for loose object storage
Teach the loose object database how to cope with SHA256 objects.
2022-06-20 17:09:47 -04:00
Edward Thomson
4d7ec76c42 odb: add git_odb_loose_backend_options
Move the arguments to `git_odb_loose` into an options structure.
2022-06-20 17:09:47 -04:00
Edward Thomson
dbccfc203e odb: accept an oid type in options
Allow the object database to take an oid type that it supports.  This
oid type will be used to validate the objects that the backends provide.
2022-06-20 17:09:46 -04:00
Edward Thomson
3eba9181cf odb: add git_odb_options
Users will need to be able to specify the object id type for the given
object database; add a new `git_odb_options` with that option.
2022-06-20 17:05:30 -04:00
Edward Thomson
8444b6dce7 odb_hash*: accept the oid type to hash into
The git_odb_hash helper functions should not assume SHA1, and instead
should be given the oid type that they're producing.
2022-06-20 17:05:29 -04:00
Edward Thomson
14798060a6 oid: specify a default implementation
libgit2's current default oid type is SHA1, set a public macro for that.
2022-06-20 17:05:29 -04:00
Edward Thomson
0db1c57cf0 oid: add sha256 typed oids 2022-06-20 17:05:29 -04:00
Edward Thomson
3fbf580c91 oid: give oids a type
`git_oid`s now have a type, and we require the oid type when creating
the object id from creation functions.
2022-06-20 17:05:29 -04:00
Edward Thomson
c43601160b oid: include maximum oid raw/hex sizes 2022-06-14 22:29:57 -04:00
Edward Thomson
74ffce2078 oid: introduce git_oid_t
We require an enumeration to help us identify the different types of
object IDs.  Currently, we only support SHA1 but we will support SHA256
in the future.
2022-06-14 22:29:57 -04:00
Edward Thomson
0acaf3a8eb oid: define GIT_OID_SHA1_ZERO
Callers should not assume the layout of the oid structure; provide them
a macro that defines the null / zero sha1 object id.
2022-06-14 22:29:57 -04:00
Edward Thomson
dbc4ac1c76 oid: GIT_OID_*SZ is now GIT_OID_SHA1_*SIZE
In preparation for SHA256 support, `GIT_OID_RAWSZ` and `GIT_OID_HEXSZ`
need to indicate that they're the size of _SHA1_ OIDs.
2022-06-14 22:29:57 -04:00
Edward Thomson
fb68f18071 status: update documentation for default options 2022-06-13 21:44:05 -04:00
Edward Thomson
1ed1e19afa config: update config entry iteration lifecycle 2022-06-13 21:23:42 -04:00
Edward Thomson
cc4c37ca9e transport: remove git_transport_smart_proxy_options
Snuck in during refactoring; let's get rid of it.
2022-06-12 10:50:43 -04:00
lhchavez
0a7c00be7f Merge remote-tracking branch 'origin/main' into main 2022-06-11 14:31:16 -07:00
lhchavez
a75416761c Apply suggestions from code review
Co-authored-by: Edward Thomson <ethomson@github.com>
2022-06-11 14:29:15 -07:00
Aleksey Kulikov
9af5db9a5f docs: fix couple of typos 2022-04-28 17:06:54 +03:00
Edward Thomson
a1c94e9491 Merge pull request #6277 from cschlack/sys_transport_missing_include
Fix missing include
2022-04-25 09:15:59 -04:00
lhchavez
1d88605ca9 transport: introduce git_transport_smart_remote_connect_options
6fc6eeb66c removed
`git_transport_smart_proxy_option`, and there was nothing added to
replace it. That made it hard for custom transports / smart
subtransports to know what remote connect options to use (e.g. proxy
options).

This change introduces `git_transport_smart_remote_connect_options` to
replace it.
2022-04-16 08:23:22 -07:00
Christian Schlack
a6fb41ff88 Fix missing include 2022-04-16 14:56:23 +02:00
lhchavez
88f2438452 remote: Delete a now-inexistent API declaration
6fc6eeb66c replaced the remote options
with `git_remote_connect_options`. The function definitions were
removed, but one function declaration remained, causing linker errors if
one tried to use it.

This change removes the declaration of
`git_transport_smart_proxy_option` to better reflect reality.
2022-04-14 07:20:56 -07:00
Edward Thomson
4161ebdd50 repo: make ownership checks optional
Introduce the `GIT_OPT_SET_OWNER_VALIDATION` option, so that users can
disable repository ownership validation.
2022-04-11 22:17:52 -04:00
Edward Thomson
c0dfd1ad97 repo: ensure that repo dir is owned by current user
Ensure that the repository directory is owned by the current user; this
prevents us from opening configuration files that may have been created
by an attacker.
2022-04-11 22:15:45 -04:00
Edward Thomson
36df49c26d sha: GIT_ERROR_SHA1 is deprecated in favor of GIT_ERROR_SHA
The more generic GIT_ERROR_SHA allows for SHA256 errors as well as SHA1.
2022-03-23 08:39:19 -04:00
Edward Thomson
49e180c862 errors: expose git_error_set
The `git_error_set` function is useful for callers who implement
backends and advanced callbacks.  Expose it.
2022-02-22 22:07:44 -05:00