Commit Graph

16024 Commits

Author SHA1 Message Date
Edward Thomson
1b348a3134 Merge pull request #7026 from emilazy/push-npwwprvzrmmr
conflict tests: check `core.ignorecase`
2025-01-21 13:42:07 -08:00
Emily
96bdc04fbb conflict tests: check core.ignorecase
Not all filesystems on Apple and Windows platforms are
case‐insensitive; this test would previously fail on a
case‐sensitive APFS volume.
2025-01-21 21:19:32 +00:00
Edward Thomson
3eadce3d0b Merge pull request #7019 from vapier/main
alternates: allow relative paths in all repositories
2025-01-21 13:04:10 -08:00
Edward Thomson
99dbff8d7c Merge pull request #7025 from libgit2/ethomson/test_updates
Test updates
2025-01-21 05:10:01 -08:00
Edward Thomson
346930e280 Merge pull request #7018 from libgit2/ethomson/icase_filters
attr: honor ignorecase in attribute matching
2025-01-20 15:09:50 -08:00
Edward Thomson
c48364cd6a filter: set a temporary sysdir in test
The filter tests mutate state, and should set a temporary sysdir to do
so.
2025-01-20 22:45:59 +00:00
Edward Thomson
21af9ec86c test: set a temporary PROGRAMDATA directory
Like we set temporary system and global configuration directories, we
need to set a programdata directory for safe test handling.
2025-01-20 22:45:53 +00:00
Edward Thomson
90465353a5 Merge pull request #7022 from carlo-bramini/fix-cygwin-1 2025-01-20 11:04:04 -08:00
Carlo Bramini
63cffe3d21 cli: fix undefined alloca() on CYGWIN
I tried to build my libgit2-1.9.0 package for CYGWIN but I got an error. This message appears when compiling:

[199/671] Building C object src/cli/CMakeFiles/git2_cli.dir/opt.c.o
libgit2-1.9.0/src/cli/opt.c: In function ‘cli_opt_parse’:
libgit2-1.9.0/src/cli/opt.c:564:23: warning: implicit declaration of function ‘alloca’; did you mean ‘malloc’? [-Wimplicit-function-declaration]
  564 |         given_specs = alloca(sizeof(const cli_opt_spec *) * (args_len + 1));
      |                       ^~~~~~
      |                       malloc

and later the linker emits this error message:

[668/671] Linking C executable git2.exe
FAILED: git2.exe
/usr/x86_64-pc-cygwin/bin/ld: src/cli/CMakeFiles/git2_cli.dir/opt.c.o: in function `cli_opt_parse':
/usr/src/debug/libgit2-1.9.0-1/src/cli/opt.c:564:(.text+0xce3): undefined reference to `alloca'
collect2: error: ld returned 1 exit status

The error is fixed by adding alloca.h to included headers.
Hopefully, opt.c already allows to add alloca.h for some platforms, so I just added an additional test for the preprocessor for checking if the target is CYGWIN.
2025-01-20 12:34:50 +01:00
Mike Frysinger
17cbd2eae0 alternates: allow relative paths in all repositories
Git does not limit relative paths in alternates to the first
repository, so libgit2 shouldn't either.
2025-01-15 21:25:30 -05:00
Edward Thomson
906623b8f9 attr: honor ignorecase in attribute matching
`.gitattributes` is case-insensitive when `core.ignorecase=true`.
2025-01-15 22:44:51 +00:00
Edward Thomson
6330ca3c0f version: add size information
Add `sizeof-long` and `sizeof-size_t` information to `version` command.
2025-01-15 09:28:28 +00:00
Edward Thomson
1509637751 Introduce git_libgit2_buildinfo
Track some information about the compilation at compile time, and allow
consumers to query it.
2025-01-15 09:28:26 +00:00
Edward Thomson
9692f45ca8 Merge pull request #7014 from libgit2/ethomson/index-bench
flamegraph: theme for libgit2 benchmarks site
2025-01-14 15:45:52 +00:00
Edward Thomson
f9e9ddd884 flamegraph: theme for libgit2 benchmarks site 2025-01-14 12:48:28 +00:00
Edward Thomson
7daaf6151a Merge pull request #7010 from libgit2/ethomson/index-bench
Add profiling data to benchmarks
2025-01-13 23:19:48 +00:00
Edward Thomson
02435d7647 ci: benchmark workflow improvements
Publish the site as an artifact during workflow_dispatch events.
2025-01-13 21:23:04 +00:00
Edward Thomson
9c2b827cef ci: disable perf_event_paranoid on linux CI 2025-01-13 21:23:04 +00:00
Edward Thomson
99ab224882 ci: produce flamegraphs during benchmark run 2025-01-13 21:23:04 +00:00
Edward Thomson
89f0dab789 ci: build benchmarks as release with debugging info
Our benchmarks need debugging information for (eg) profiling.
2025-01-13 21:23:04 +00:00
Edward Thomson
008c6f7984 benchmarks: optionally generate and publish flamegraphs 2025-01-13 21:23:02 +00:00
Edward Thomson
dfbdaa28a5 benchmark: introduce profiling support
Introduce `--profile` support to the benchmark helper script, which will
invoke `perf` on Linux. Additionally, add a `--flamegraph` output
option based on that.
2025-01-13 21:21:17 +00:00
Edward Thomson
6bc64fb56e Merge pull request #7012 from lrm29/patch-1
Update SelectSSH.cmake
2025-01-13 20:48:50 +00:00
Laurence McGlashan
1d2bdab7f8 Update SelectSSH.cmake 2025-01-13 12:16:44 +00:00
Edward Thomson
6fedfd3237 Add benchmark for large-ish (250mb) index-pack 2025-01-11 21:58:19 +00:00
Edward Thomson
343c2cbae8 benchmarks: report commit of build
It can be useful to report the commit ID during benchmarks to track down
regressions; leverage the addition of that in `git version` during
benchmark runs.
2025-01-09 23:44:23 +00:00
Edward Thomson
1ec9d2c7c6 Merge pull request #7006 from libgit2/ethomson/benchmarks
benchmarks: update path to baseline cli
2025-01-09 23:33:48 +00:00
Edward Thomson
436f4e7d96 benchmarks: update path to baseline cli
The `fullpath` function takes the cli, but doesn't keep the cli.
2025-01-09 21:45:11 +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