Commit Graph

16120 Commits

Author SHA1 Message Date
Edward Thomson
f4eee4fa9a Merge pull request #7208 from libgit2/ethomson/oidbench
ab tests: enable sha256
2026-01-31 14:07:26 +00:00
Edward Thomson
7ef512a828 ab tests: enable sha256 2026-01-31 13:58:52 +00:00
Edward Thomson
b1a826a7ff Merge pull request #7207 from libgit2/ethomson/oidbench
Benchmark the OID code
2026-01-26 23:41:43 +00:00
Edward Thomson
9935da4661 ci: optionally run benchmarks 2026-01-26 23:40:53 +00:00
Edward Thomson
c0f5c9bd80 ci: generate markdown results from benchmarks 2026-01-26 23:02:06 +00:00
Edward Thomson
928a81e872 microbenchmarks: benchmark the oid code
At present, the library's oid manipulation functions are slower when
built in SHA256 mode than when not. Add some microbenchmarks around the
oid compare and copy functions to understand this better.
2026-01-26 21:43:06 +00:00
Edward Thomson
d55ff3cd70 clar: fix remove unused 2026-01-26 21:43:06 +00:00
Edward Thomson
3ac6bf801c clar: avoid iterator clobbered by longjmp
If the iterator is moved to a register, it may be clobbered by the
longjmp. Avoid this by treating it as volatile.
2026-01-26 21:43:06 +00:00
Edward Thomson
1a0bbabe30 clar update for benchmarks 2026-01-26 21:43:06 +00:00
Edward Thomson
8fda867e46 benchmarks: move them to their own folder
Benchmarks aren't really tests, don't keep them in the `tests` folder.
2026-01-26 21:43:06 +00:00
Edward Thomson
1424585fb6 tests: move clar to deps
Clean up the `tests` folder to only contain _actual tests_. Since clar
is now a reasonably external project, move it to `deps`.
2026-01-26 21:43:06 +00:00
Edward Thomson
77028ee987 Merge pull request #7206 from libgit2/ethomson/nogcc
pcre: actually fix dangling-pointer warning
2026-01-26 21:39:17 +00:00
Edward Thomson
b8f6ff30ee pcre: actually fix dangling-pointer warning 2026-01-26 11:00:08 +00:00
Edward Thomson
02ac171a58 Merge pull request #7205 from libgit2/ethomson/nogcc
pcre: update cmake warnings for non-gcc
2026-01-26 10:33:12 +00:00
Edward Thomson
1114364b87 pcre: update cmake warnings for non-gcc 2026-01-26 09:57:40 +00:00
Edward Thomson
7983915250 Merge pull request #7203 from libgit2/ethomson/gcc
Fix some warnings with gcc
2026-01-25 17:12:43 +00:00
Edward Thomson
6720d66b2f hashmap: tests initialize to NULL to avoid warnings 2026-01-25 16:53:58 +00:00
Edward Thomson
ea87da84a8 config: tests set entry to NULL to avoid warnings 2026-01-25 16:53:58 +00:00
Edward Thomson
ba39ae2c59 pcre: avoid false positive dangling pointer warning
PCRE sets the contents of an external structure to a local pointer
temporarily. gcc warns about this. Silence that dangling pointer
warning.
2026-01-25 16:48:56 +00:00
Edward Thomson
e9cfa20206 Merge pull request #7192 from bakersdozen123/main
Fix `git_index_entry` documentation
2026-01-16 22:23:44 +00:00
bakersdozen123
b4eb482bc9 Fix git_index_entry documentation
Change from "Documentation/technical/index-format.txt" to "Documentation/gitformat-index.adoc". Fixes #7115.
2026-01-11 18:07:28 -08:00
Edward Thomson
d908000464 Merge pull request #7190 from libgit2/ethomson/config
config: Fix potential null value passed to %s
2026-01-11 22:52:34 +00:00
Edward Thomson
8fe2c189e5 config: consistent error messages 2026-01-11 01:01:21 +00:00
Edward Thomson
53eca10648 Merge pull request #7185 from weihanglo/remote-oid-type
feat(remote): expose `git_remote_oid_type`
2026-01-11 00:58:10 +00:00
Edward Thomson
77c217f173 Merge pull request #7183 from weihanglo/smart
fix(smart): keep caps across RPC stream resets
2026-01-11 00:55:29 +00:00
Edward Thomson
0f07d810fe Merge pull request #7189 from libgit2/ethomson/clar-update
clar: update to latest
2026-01-10 20:42:52 +00:00
Edward Thomson
219730325e clar: update to latest 2026-01-10 20:17:08 +00:00
Weihang Lo
6893894f4b feat(remote): expose git_remote_oid_type
This would be useful for user to determine whether they want to proceed
or bail further remote operations. Particularily useful for downstream
libgit2 bindings and applications to experiment SHA256 support behind a
runtime feature flag.

For example, `cargo` could compile with sha256 support unconditionally,
but reject SHA256 usage at runtime if the `-Zgit=sha256` nightly flag
was not on. Cargo would leverage this new API to determine if users are
trying to fetch a SHA256 remote repository and bail when needed before
any fetches happen.

Note that this is not gated behind `GIT_EXPERIMENTAL_SHA256` as the
oid_type is sha1 and available always.
2026-01-10 10:59:47 -05:00
Edward Thomson
b154967667 Merge pull request #7186 from AHSauge/fix/optimise-git-oid-is-zero
Use git_oid_raw_cmp instead of custom loop in git_oid_is_zero
2026-01-10 13:33:58 +00:00
Edward Thomson
e2105f3a8b Merge pull request #7181 from Murmele/wrong_comment
fix wrong comment
2026-01-10 13:32:58 +00:00
Edward Thomson
dff04d9dcc Merge pull request #7187 from libgit2/ethomson/nsec
index: support USE_NSEC=OFF
2026-01-08 23:04:55 +00:00
Edward Thomson
a09440a4f5 index: support USE_NSEC=OFF
Ideally, nobody should be building without nanosecond precision. But
support them if they do.
2026-01-08 22:39:56 +00:00
Edward Thomson
c5105a07dd Merge pull request #7172 from Oblivionsage/main
delta: fix undefined behavior in hdr_sz varint parsing
2026-01-08 21:25:44 +00:00
Edward Thomson
28b244aa40 Merge pull request #7179 from weihanglo/sha256
fix(sha256): pass correct oid type
2026-01-08 14:33:25 +00:00
Edward Thomson
6460642539 Merge pull request #7173 from libgit2/ethomson/clar-update
tests: update to latest clar
2026-01-08 14:32:33 +00:00
Edward Thomson
6a41fb7870 tests: update to latest clar 2026-01-08 01:03:42 +00:00
Edward Thomson
2c3ce41c60 Merge pull request #7166 from bakersdozen123/main
Add swift-libgit2 language binding to README
2026-01-07 23:01:57 +00:00
Edward Thomson
9ced0a3731 Merge pull request #7175 from qaqland/main
examples: correct `git_commit_time` comment
2026-01-07 22:59:17 +00:00
Alf Henrik Sauge
73b8b4eb74 Use git_oid_raw_cmp instead of custom loop in git_oid_is_zero
Since git_oid_raw_cmp uses memcmp, it's far easier to optimise more aggressively.
Given that it's static const and used inlined, it seems reasonable to assume that git_oid_zero will be optimised away in release. 
This is at least the case with x86-64 and GCC 15.2.1.
2026-01-06 20:20:46 +01:00
Weihang Lo
e15479a7dc fix(smart): keep caps across RPC stream resets
Preserve ref-advertised capabilities when only the stream is reset.

This prevents losing `object-format` before `git_remote_oid_type()`
and fixes SHA256 clone pack trailer mismatch.

Fixes libgit2/libgit2#7182
2026-01-03 22:02:42 -05:00
Martin Marmsoler
0e3200a8fc fix wrong comment 2026-01-03 17:02:51 +01:00
Weihang Lo
e1cd4f6595 fix(sha256): pass correct oid type
These are SHA256 TODO leftover.
In the surrounding context they all have the required oid type around,
so I just picked up them and pass in.

Found during SHA256 support integration with Rust git-rs binding
2026-01-03 10:12:12 -05:00
qaqland
196c465995 examples: correct git_commit_time comment 2025-12-31 16:36:04 +08:00
Oblivionsage
4e6b493787 delta: fix undefined behavior in hdr_sz varint parsing
The expression (c & 0x7f) << shift in hdr_sz() causes undefined
behavior when shift >= 32, because (c & 0x7f) is an unsigned int
(32-bit type). A malicious delta with a long varint can trigger this.

Fix by:
1. Casting to size_t before shifting to support 64-bit shifts
2. Adding a shift limit check to reject overlong varints
2025-12-24 16:46:30 +01:00
Edward Thomson
3ac4c0adb1 Merge pull request #7148 from roberth/refs-shorthand-multi-segment
refs: honor REFSPEC_SHORTHAND for multi-segment refs
2025-12-20 13:08:02 +00:00
Edward Thomson
cd3ebc944e Merge pull request #7164 from ambv/fix-discarded-qualifiers
ci: Fix cases of -Werror=discarded-qualifiers raised by gcc 15.2
2025-12-20 13:05:42 +00:00
Edward Thomson
1fed8b2e95 Merge pull request #7167 from ambv/macos-14 2025-12-19 21:05:34 +00:00
Łukasz Langa
0bf4714508 (Another bump, this time github.com was not accessible from GitHub Actions) 2025-12-12 00:42:53 +01:00
Łukasz Langa
2b7114047e (bump CI as curl failed) 2025-12-11 19:01:19 +01:00
Łukasz Langa
81ba023838 Some versions of leaks want -exclude to not have a space 2025-12-11 18:11:50 +01:00