Commit Graph

15947 Commits

Author SHA1 Message Date
Edward Thomson
e80f39f8ba test 2025-01-09 18:03:55 +00:00
Edward Thomson
e2dfceacc6 Merge pull request #7004 from kanavin/fix-cmake-files-install
src/libgit2/CMakeLists.txt: install cmake files into configured libdir
2025-01-07 22:27:56 +00:00
Edward Thomson
9305c345e8 Merge pull request #7005 from libgit2/ethomson/v19_changelog
docs: add `update_refs` as ABI breaking change
2025-01-07 20:58:20 +00:00
Edward Thomson
1c6d51142d docs: add update_refs as ABI breaking change
In v1.9, we failed to document that `update_refs` was a breaking change.
Add information about this change to the ABI breaking changes section.
2025-01-07 20:29:44 +00:00
Alexander Kanavin
904c8f266d src/libgit2/CMakeLists.txt: install cmake files into configured libdir
libdir can be something else than /usr/lib, e.g. /usr/lib64 or similar.
2025-01-07 19:01:49 +01:00
Edward Thomson
15d24af7bc Merge pull request #6999 from libgit2/ethomson/remove_weird_bundled_deps
Remove strange bundled libssh2 and chromium
2025-01-07 16:10:13 +00:00
Edward Thomson
caa65e0e9f Merge pull request #7000 from libgit2/ethomson/object_type 2025-01-03 14:01:24 +00:00
Edward Thomson
23da3a8f3c object: remove OFS_DELTA and REF_DELTA values
Deltas are not objects, they're entries in a packfile. Remove them from
the object enum.
2025-01-03 13:28:19 +00:00
Edward Thomson
2d5942571c object: introduce type_is_valid
There's no such thing as a "loose object type" or a "packed object
type". There are only object types. Introduce `type_is_valid` and
deprecate `typeisloose`.
2025-01-03 13:28:19 +00:00
Edward Thomson
666bbed4d4 Merge pull request #6998 from peter15914/fix_check_calloc
FIx potential null dereference
2025-01-03 09:00:00 +00:00
Edward Thomson
dafe14ce65 Merge pull request #6346 from libgit2/ethomson/reference_cmp
refs: make `git_reference_cmp` consider the name
2025-01-02 23:14:40 +00:00
Edward Thomson
4802272f68 cmake: remove "embedded libssh2"
Compiling libssh2 into libgit2 directly is madness. If users want to
create a single library that contains libssh2, then they should link a
static library.
2025-01-02 21:13:50 +00:00
Edward Thomson
a7c4c7d8c8 deps: remove chromium-zlib
Remove the ability to compile-in chromium zlib. If users want to supply
their own zlib implementation, it should be external to our build
environment.
2025-01-02 21:13:11 +00:00
Edward Thomson
842fcef3eb Merge pull request #6997 from florianpircher/patch-1
include: Fix code comment termination
2025-01-02 20:26:06 +00:00
peter15914
01c16e6aa7 transport: сheck a pointer allocation result
GIT_ERROR_CHECK_ALLOC was added to check the return value of git__calloc().
2025-01-03 01:22:53 +05:00
Edward Thomson
a0d432660a Merge pull request #6994 from libgit2/ethomson/cmake 2025-01-02 17:56:41 +00:00
Florian Pircher
2fa13adf09 include: Fix code comment termination 2025-01-02 17:19:58 +01:00
Edward Thomson
270d8019cd Merge pull request #6975 from libgit2/ethomson/sha256_simplification 2025-01-02 14:22:44 +00:00
Edward Thomson
c605f4281b Merge pull request #6995 from libgit2/ethomson/cmd_version
cli: add version command
2025-01-02 13:14:41 +00:00
Edward Thomson
80ce38c9d9 Merge pull request #6996 from libgit2/ethomson/sha256_int
hash: allow `unsigned int` != `size_t` in sha256
2025-01-02 13:14:20 +00:00
Edward Thomson
c26d8a8b54 sha256: further API simplifications for OID parsing
Introduce `git_oid_from_string`, `git_oid_from_prefix`, and
`git_oid_from_raw`, all of which take a `git_oid_t` that indicates what
type of OID should be parsed (SHA1 or SHA256).

This allows users to continue to use `git_oid_fromstr` without any code
changes, while remaining in a SHA1 world.

Note that these are not perfect analogs to the `fromstr` APIs.

* `git_oid_from_string` now takes a NUL terminated string, instead of
  allowing for non-NUL terminated strings. Adding a NUL check feels like
  an important safety consideration for C strings.
* `git_oid_from_prefix` should be used for an OID substring and length.

Previous usages of `git_oid_fromstr` with non-NUL terminated strings
should move to `git_oid_from_prefix` with the hexsize for the given OID
type.
2025-01-02 13:13:59 +00:00
Edward Thomson
56e2a85643 sha256: simplify API changes for sha256 support
There are several places where users may want to specify the type of
object IDs (sha1 or sha256) that should be used, for example, when
dealing with repositories, indexes, etc.

However, given that sha256 support remains disappointingly uncommon in
the wild, we should avoid hard API breaks when possible. Instead, update
these APIs to have an "extended" format (eg, `git_odb_open_ext`) that
provides an options structure with oid type information.

This allows callers who do care about sha256 to use it, and callers who
do not to avoid gratuitous API breakage.
2025-01-02 13:13:59 +00:00
Edward Thomson
fb7fef0d72 hash: allow unsigned int != size_t in sha256
Our bundled SHA256 implementation passes a `size_t` as an `unsigned
int`. Stop doing that.
2025-01-02 12:39:54 +00:00
Edward Thomson
24d50ad87b cli: add version command
Move the `--version` information into its own command, so that we can
support `--build-options`.
2025-01-02 12:39:33 +00:00
Edward Thomson
4546929e00 cmake: case insensitive options
It's hard to remember whether it's `-DUSE_HTTPS=mbedTLS` or
`-DUSE_HTTPS=mbedtls`. Even worse for things like `builtin` which we may
have been inconsistent about. Allow for case insensitive options.
2025-01-02 12:36:46 +00:00
Edward Thomson
5a654f11bb cmake: update git2_features.h
Reorganize the libgit2 feature selection file.
2025-01-02 12:36:45 +00:00
Edward Thomson
c4c284e46f cmake: standardize HTTPS backend definitions
There were a few oddities around HTTPS provider selection: namely,
`GIT_OPENSSL_DYNAMIC` implied `GIT_OPENSSL`, which made a bit of sense,
until we added FIPS support. In addition, dynamic OpenSSL for _hashes_
and dynamic OpenSSL for HTTPS was conflated in a few places.

Untangle these, and make `GIT_HTTPS_*` the define, for consistency with
other feature provider selection.
2025-01-02 12:36:11 +00:00
Edward Thomson
c42ccfaa34 cmake: don't report futimes enablement
futimes is not an option; don't report enablement as such.
2025-01-02 12:36:11 +00:00
Edward Thomson
9efdbe3834 cmake: standardize leak check option
The `GIT_WIN32_LEAKCHECK` option is a debugging option, so it should be
`GIT_DEBUG_LEAKCHECK_WIN32`
2025-01-02 12:36:11 +00:00
Edward Thomson
94d8883dcf cmake: update verbiage on feature enablement 2025-01-02 12:36:11 +00:00
Edward Thomson
bab249d82e cmake: standardize xdiff options 2025-01-02 12:36:11 +00:00
Edward Thomson
2b581ef517 cmake: update threads
For consistency with other backend/provider selection, allow
`USE_THREADS` to select the threads provider.
2025-01-02 12:36:11 +00:00
Edward Thomson
890d70856c cmake: update nanosecond selection
For consistency, specify the nanosecond option in the same way as other
options, and identify it as such. Split the detection of platform
support (`FindStatNsec`) and its selection (`SelectNsec`).
2025-01-02 12:36:11 +00:00
Edward Thomson
8bbd2f406e cmake: use DEBUG_LEAK_CHECKER as option
The `USE_` prefix for inputs denotes a backend; the `DEBUG_` prefix
denotes a debugging option. Make `DEBUG_LEAK_CHECKER` the name of the
leak checking option.
2025-01-02 12:36:11 +00:00
Edward Thomson
c9974d28b2 cmake: update Negotiate backend selection 2025-01-02 12:36:11 +00:00
Edward Thomson
fb59acb246 cmake: update NTLM feature enablement 2025-01-02 12:36:09 +00:00
Edward Thomson
9ea1f6d4ed cmake: standardize iconv options 2025-01-02 11:45:47 +00:00
Edward Thomson
78a8c44cc1 cmake: standardize regex options
Selecting regular expression backend should be specified in the same way
as everything else; `USE_REGEX`. Keep `REGEX_BACKEND` as an optional
fallback.
2025-01-02 11:45:47 +00:00
Edward Thomson
fdb73f5d1d cmake: simplify compression selection 2025-01-02 11:45:47 +00:00
Edward Thomson
c4a65c34c2 cmake: standardize builtin sha1dc selection
All `USE_*` options are now `builtin`. Use that for the builtin sha1dc
implementation, keeping `CollisionDetection` for backward compatibility.
2025-01-02 11:45:47 +00:00
Edward Thomson
9961198879 Merge pull request #6982 from libgit2/ethomson/no_dotgit_for_separate_workdir
No `.git` for separate workdir
2024-12-30 21:17:43 +00:00
Edward Thomson
ca2a241e4c repo: workdir_path implies no dotgit in init
When specifying a separate working directory path, the given repository
path should never have a `.git` directory created beneath it. That
simply doesn't make sense.

As a result, the `GIT_REPOSITORY_INIT_NO_DOTGIT_DIR` now _also_ no
longer makes sense. It would only ever be a sensible option when one
wanted a separate `.git` directory and working directory, otherwise the
git files and working directory files would be comingled. Remove the
option entirely.
2024-12-30 20:36:13 +00:00
Edward Thomson
e9d97bedc2 Merge pull request #6966 from libgit2/ethomson/tls
ssl: enforce TLS v1.2 (or better)
2024-12-28 23:44:12 +00:00
Edward Thomson
338e6fb681 Merge pull request #6990 from libgit2/ethomson/ci v1.9.0 2024-12-28 12:01:25 +00:00
Edward Thomson
76fe3978ae Merge pull request #6989 from libgit2/ethomson/readme 2024-12-28 11:49:15 +00:00
Edward Thomson
e447de936d ci: only build docs on main branch pushes
Don't build docs on pushes to maint branches; those docs should only be
built _on release_. In addition, be safer about not creating an existing
branch from a tracking branch.
2024-12-28 10:59:12 +00:00
Edward Thomson
d7f3fb568e README: add v1.9 builds 2024-12-28 10:27:39 +00:00
Edward Thomson
25d87c2d89 Merge pull request #6987 from libgit2/ethomson/changelog
v1.9: final changelog updates
2024-12-28 10:24:16 +00:00
Edward Thomson
1329f1a1db v1.9: final changelog updates 2024-12-28 10:02:09 +00:00
Edward Thomson
a8fbbf77b8 Merge pull request #6986 from libgit2/ethomson/warn_sha1
cmake: warn for not using sha1dc
2024-12-28 09:58:25 +00:00