15506 Commits

Author SHA1 Message Date
Edward Thomson
d74d491481 Merge pull request #6767 from libgit2/ethomson/v18
Release v1.8
v1.8.0
2024-03-20 20:19:37 +00:00
Edward Thomson
69f2577110 v1.8: update changelog 2024-03-20 08:21:43 +00:00
Edward Thomson
5aa3ce7225 v1.8: update version numbers 2024-03-20 08:19:09 +00:00
Edward Thomson
7940f094a5 v1.8: update COPYING file
Include the ntlmclient dependency's license file.
2024-03-20 08:19:09 +00:00
Edward Thomson
115db540cf Merge pull request #6772 from libgit2/ethomson/actions
ci: split SHA256 builds out into their own workflow
2024-03-19 07:42:23 +00:00
Edward Thomson
9288436e38 ci: split SHA256 builds out into their own workflow
Split the SHA256 builds into their own workflow; since they're
experimental (and have proven to be flaky) they shouldn't be used as
signal that there's a problem with a PR.
2024-03-19 07:01:01 +00:00
Edward Thomson
0f12a011ab Merge pull request #6770 from libgit2/ethomson/ctype
cast characters to unsigned when classifying characters
2024-03-18 11:31:39 +00:00
Edward Thomson
467556993f ntlmclient: use unsigned char for ctype functions 2024-03-18 11:07:47 +00:00
Edward Thomson
8e6beb3d16 ctype: switch to git__ ctype functions
Use the `git__` ctype functions (`git__isdigit` and friends) instead of
explicitly casting.
2024-03-18 11:07:47 +00:00
Edward Thomson
647f8eb987 ctype: only use custom functions on Windows
The Microsoft C runtime (MSVCRT) may take a heavy lock on the
locale in order to figure out how the `ctype` functions work.
This is deeply slow. Provide our own to avoid that.

On POSIX, provide emulation for that functionality using the ctype
functions, but compress the return value into a `bool`, and cast the
value to an `unsigned char`.
2024-03-18 11:07:47 +00:00
Edward Thomson
06c0ac658f Merge pull request #6769 from libgit2/ethomson/valgrind
valgrind: suppress OpenSSL warnings
2024-03-18 11:04:08 +00:00
Edward Thomson
4504f2c5cf valgrind: suppress OpenSSL warnings 2024-03-18 10:33:44 +00:00
Edward Thomson
a035aa4b97 Merge pull request #6768 from libgit2/ethomson/v18_fixes
Last minute fixes for v1.8
2024-03-18 06:49:40 +00:00
Edward Thomson
dd35af37d8 repository: rearrange git_repository_item_t values
Update the ordering of `GIT_REPOSITORY_ITEM_WORKTREE_CONFIG` to avoid
breaking the ABI unnecessarily.
2024-03-17 21:52:11 +00:00
Edward Thomson
2eb3fecd03 fetch: avoid API breaking-changes from v1.7
Update `git_fetch_options` to break out the fetch options into
individual options. This prevents creating an API breaking change from
v1.7.0. `git_remote_update_tips` retains the `update_flags` to also
avoid an API breaking change.
2024-03-17 21:26:27 +00:00
Edward Thomson
2fe50e295d Merge pull request #6766 from libgit2/ethomson/configfix
config: correct fetching the HIGHEST_LEVEL config
2024-03-17 14:32:21 +00:00
Edward Thomson
cc7764f6a6 config: correct fetching the HIGHEST_LEVEL config
Also, add a test for fetching the `GIT_CONFIG_HIGHEST_LEVEL`.
2024-03-17 14:11:40 +00:00
Edward Thomson
ecf2c64fb5 Merge pull request #6765 from libgit2/ethomson/actions
build: update to latest actions versions
2024-03-16 18:42:17 +00:00
Edward Thomson
58dfe647b7 build: update to latest actions versions 2024-03-16 18:17:16 +00:00
Edward Thomson
47b7d72d2c Merge pull request #6759 from adamharrison/PR/mbedtls3
Allow libgit2 to be compiled with mbedtls3.
2024-03-16 18:10:05 +00:00
Edward Thomson
c2ed49c78e Merge pull request #6756 from libgit2/ethomson/worktree-config
Separate config reader and writer backend priorities (for worktree configs)
2024-03-16 16:36:22 +00:00
Edward Thomson
3266fc4938 mbedtls: keep track of what we allocate, then free it
Instead of trying to allocate something, hand it to mbedTLS, and then
peer into its private data structures to try to free that thing... we
could just keep track of it ourselves.

Once we've done that, we needn't do an allocation _anyway_, we can just
keep it on the stack.
2024-03-16 15:52:46 +00:00
Edward Thomson
079861729b build: update ntlmclient dependency
The ntlmclient dependency now bundles an MD4 implementation for
compatibility with newer mbedTLS. Include that so that we can support
mbedTLS 3.
2024-03-16 14:32:54 +00:00
Edward Thomson
594063935b cli: use libgit2 system includes
libgit2 may adjust the system includes - for example, to locate a
dependency installed in a funny location. Ensure that the cli
understands those include paths as well.
2024-03-16 14:31:55 +00:00
Edward Thomson
844e7b3bbe Merge pull request #6762 from libgit2/ethomson/zlib
packbuilder: adjust nondeterministic tests
2024-03-16 14:22:44 +00:00
Edward Thomson
b70dd12706 packbuilder: adjust nondeterministic tests
The packbuilder tests should be deterministic. This comment suggests
that they are:

```
/*
 * By default, packfiles are created with only one thread.
 * Therefore we can predict the object ordering and make sure
 * we create exactly the same pack as git.git does when *not*
 * reusing existing deltas (as libgit2).
 *
 * $ cd tests/resources/testrepo.git
 * $ git rev-list --objects HEAD | \
 *  git pack-objects -q --no-reuse-delta --threads=1 pack
 * $ sha1sum pack-7f5fa362c664d68ba7221259be1cbd187434b2f0.pack
 * 5d410bdf97cf896f9007681b92868471d636954b
 *
 */
```

but it is disappointingly incorrect. As is evidenced by the fact that --
at least on _my_ machine -- that command does not actually produce that
output any longer.

Variations in things like the which compression library is actually
used, and its defaults, mean that we cannot accurately predict or
enforce the bytes in the packfile from one system to another.

Adjust the tests so that they do not believe that they should enforce
the bytes in the packfile. This allows broader compatibility with
zlib-compatible compression libraries, or other compression levels.
2024-03-16 12:19:16 +00:00
Edward Thomson
ea5e999540 Merge pull request #6764 from libgit2/ethomson/cifix
ci: reduce ASLR randomization for TSAN
2024-03-16 12:18:12 +00:00
Edward Thomson
53978e6784 ci: reduce ASLR randomization for TSAN
Linux updated its ASLR randomization in a way that is incompatible with
TSAN. See https://github.com/google/sanitizers/issues/1716

Reducing the randomness for ASLR allows the sanitizers to cope.
2024-03-16 11:44:39 +00:00
Edward Thomson
e3d11454fe Merge pull request #6761 from libgit2/ethomson/message_trailer
Fix message trailer parsing
2024-03-16 11:23:33 +00:00
Edward Thomson
8f33d0e06b Merge pull request #6763 from libgit2/ethomson/oops
tests: don't free an unininitialized repo
2024-03-16 11:23:05 +00:00
Edward Thomson
4c9353227b tests: don't free an unininitialized repo 2024-03-14 19:20:18 +00:00
Edward Thomson
d488817076 trailer: ensure we identify patch lines like git
Git looks explicitly for `---` followed by whitespace (`isspace()`) to
determine when a patch line begins in a commit message. Match that
behavior. This ensures that we don't treat (say) `----` as a patch line
incorrectly.
2024-03-14 11:28:20 +00:00
Edward Thomson
fdaf373c0e trailer: test actual array equivalence
We never test the lengths of the two arrays, so a short return from
`git_message_trailers` will match erroneously.
2024-03-14 11:27:36 +00:00
Adam Harrison
5934779ae0 Restored verify result report. 2024-03-13 17:35:39 -04:00
Adam Harrison
2625ed24b9 Initial implementation. 2024-03-13 17:20:11 -04:00
Edward Thomson
cb4b61770f Merge branch 'main' into ethomson/worktree-config 2024-03-11 22:41:25 +00:00
Edward Thomson
bad5620e04 Merge pull request #6757 from libgit2/ethomson/local_depth
fetch: fail on depth for local transport
2024-03-11 21:57:48 +00:00
Edward Thomson
b8f3dae325 fetch: fail on depth for local transport
We don't support shallow clones for the local transport, currently.
Fail, instead of silently ignoring the depth option.
2024-03-11 21:07:46 +00:00
Edward Thomson
b454eba9a7 errors: introduce GIT_ENOTSUPPORTED
libgit2 lacks many of the things that git supports. Give a reasonable
error code for these cases.
2024-03-11 21:07:21 +00:00
Edward Thomson
3baa6372fd config: read the individual worktree config
Instead of reading the worktree configuration from the commondir, read
it from the gitdir. This ensures that each worktree gets its own
configuration.
2024-03-11 15:21:12 +00:00
Edward Thomson
e890ca35aa config: only read worktree config if extension is set
Only read the worktree configuration when `extensions.worktreeconfig` is
set to true.
2024-03-11 15:20:02 +00:00
Edward Thomson
e8910c175d config: refcount the backend when we start a transaction
When we start a transaction, we should refcount the backend so that we
don't lose it. This prevents the case where we have a transaction open
and a configuration entry locked and somebody forces a new backend at
the same level and the backend is freed. Now a user can gently wind down
their transaction even when the backend has been removed from the live
configuration object.
2024-03-10 21:35:25 +00:00
Edward Thomson
d287e1a4fe config: store the backend in a transaction
When we `git_config_unlock`, we shouldn't _unlock the thing that we
locked_ instead of assuming that the highest-priority target _remains_
the highest-priority target.
2024-03-10 21:35:25 +00:00
Edward Thomson
5f85714e1f config: don't git_config_free an aborted transaction
When a configuration transaction is freed with `git_transaction_free` -
without first committing it - we should not `git_config_free`. We never
increased the refcount, so we certainly shouldn't decrease it.

Also, add a test around aborting a transaction without committing it.
2024-03-10 21:35:25 +00:00
Edward Thomson
fb187bd003 config: return GIT_EREADONLY on read-only configs
Introduce `GIT_EREADONLY` and return it when a read-only configuration
is attempted to be mutated. This is preferred over the prior
`GIT_ENOTFOUND` which is not accurate.
2024-03-10 21:35:24 +00:00
Edward Thomson
b499a3465c config: introduce a writers list
Configuration read order and write order should be separated. For
example: configuration readers have a worktree level that is higher
priority than the local configuration _for reads_. Despite that, the
worktree configuration is not written to by default.

Use a new list, `writers`, to identify the write target.

To do this, we need another level of indirection between backend
instances (which are refcounted and shared amongst different git_config
instances) and the config reader/writer list (since each of those
different git_config instances can have different read/write
priorities).
2024-03-10 21:35:24 +00:00
Edward Thomson
c95e8e344a Merge pull request #6359 from albfan/fix-log-example
fix log example
2024-03-09 21:39:50 +00:00
Edward Thomson
d7336ae7db Merge branch 'worktree_refs' 2024-03-08 22:41:57 +00:00
Edward Thomson
9baf618ced Merge remote-tracking branch 'origin/main' into worktree_refs 2024-03-08 22:02:56 +00:00
Edward Thomson
7bbb07f83f worktree: dry up the refdb_fs iterator
The refdb iterator has grown a bit and has a few concerns intermixed.
Refactor a bit to improve readability while trying to avoid unnecessary
git_str allocations.
2024-03-08 21:59:59 +00:00