Commit Graph

15930 Commits

Author SHA1 Message Date
Edward Thomson
4a4d6ee080 v1.9.1: update changelog 2025-06-06 14:40:38 +01:00
Talya Connor
455a069be7 AUTHORS: add self. 2025-06-06 13:58:55 +01:00
Talya Connor
b24b9e2782 diff: account for common prefix in max namelen. 2025-06-06 13:58:55 +01:00
Talya Connor
25bcfb33dd test: failing diff stat test. 2025-06-06 13:58:55 +01:00
Nelson Elhage
48cd7e81b7 Don't use -fsanitizer for the standalone fuzzer build. 2025-06-06 13:58:55 +01:00
Nelson Elhage
6048d2bb53 fuzzers: Fix CFLAGS
I'm seeing the current fuzzer build fail (during `cmake`) like so:

```
-- Performing Test IS_FSANITIZE_FUZZER_NO_LINK_SUPPORTED
-- Performing Test IS_FSANITIZE_FUZZER_NO_LINK_SUPPORTED - Failed
CMake Error at cmake/AddCFlagIfSupported.cmake:17 (message):
  Required flag -fsanitize=fuzzer-no-link is not supported
Call Stack (most recent call first):
  fuzzers/CMakeLists.txt:6 (add_c_flag)
```

The cmake log output contains something like so:

```
        /src/aflplusplus/libAFLDriver.a(aflpp_driver.o): in function `main':
        aflpp_driver.c:(.text+0x11b): undefined reference to `LLVMFuzzerTestOneInput'
        clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

I haven't figured out exactly what's happening, but I believe that
once line 5 has added `-fsanitize=fuzzer` to `CFLAGS`, future compile-
tests **also** use it during linking. This in turn pulls in the fuzzer
`main`, which expects an `LLVMFuzzerTestOneInput` symbol, and thus
fails.

Instead, just add `-fsanitize=fuzzer-no-link` to CFLAGS (as suggested
[by the documentation][libfuzzer]), and then use `-fsanitize=fuzzer`
only for linking the fuzzer targets. At least in my environment, this
results in a working fuzzer build.

[libfuzzer]: https://llvm.org/docs/LibFuzzer.html#fuzzer-usage
2025-06-06 13:58:55 +01:00
Yuriy Chernyshov
c38a362ec6 Fix circular includes between types.h and oid.h 2025-06-06 13:58:55 +01:00
wklatka
00598169d7 Fixed memory leak in openssl fips modes 2025-06-06 13:58:55 +01:00
Dominique Fuchs
e07acfda4a docs: correct docstring info for git_remote_url
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2025-06-06 13:58:55 +01:00
Sven Strickroth
3b8318bdd5 tag: Refuse to use HEAD as a tagname
Sync with vanilla Git, cf. https://github.com/git/git/commit/bbd445d5efd415

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2025-06-06 13:58:55 +01:00
Fabio Alessandrelli
94103d14da Fix MSVC cross compilation
Currently, the DefaultCFlags.cmake overrides the
CMAKE_STATIC_LINKER_FLAGS to suppress linker warnings about files with
no symbols defined.

This has the side effect of breaking MSVC cross compilation (where
CMAKE_STATIC_LINKER_FLAGS is used to specify the /MACHINE:ARCH flag)

This commit make sure we append to CMAKE_STATIC_LINKER_FLAGS instead of
replacing its values
2025-06-06 13:58:55 +01:00
ytnuf
0922fcc46f Revert include path regression 2025-06-06 13:58:55 +01:00
Edward Thomson
3910cde282 clar: update to latest version
Update to the latest version (in HEAD) of clar. This affords us improved
test directory creation, and the `cl_invoke` helper macro.
2025-06-06 13:58:55 +01:00
Edward Thomson
298a9ba6c0 Include common.h in version.h
Fixes #7027
2025-06-06 13:58:55 +01:00
Emily
d4a7e3c5c2 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-06-06 13:58:55 +01:00
Edward Thomson
22f0130887 filter: set a temporary sysdir in test
The filter tests mutate state, and should set a temporary sysdir to do
so.
2025-06-06 13:58:55 +01:00
Edward Thomson
ecc0a4d7c7 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-06-06 13:58:55 +01:00
Edward Thomson
b9f06e5323 attr: honor ignorecase in attribute matching
`.gitattributes` is case-insensitive when `core.ignorecase=true`.
2025-06-06 13:58:55 +01:00
Carlo Bramini
8f9e095af7 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-06-06 13:58:55 +01:00
Edward Thomson
4c57f9e565 benchmarks: update path to baseline cli
The `fullpath` function takes the cli, but doesn't keep the cli.
2025-06-06 13:58:55 +01:00
Alexander Kanavin
3900c3b0e7 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-06-06 13:58:55 +01:00
peter15914
ed642bbe43 transport: сheck a pointer allocation result
GIT_ERROR_CHECK_ALLOC was added to check the return value of git__calloc().
2025-06-06 13:58:55 +01:00
Edward Thomson
e855bd57c6 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-06-06 13:58:55 +01:00
Edward Thomson
93aee581e2 ci: update download-artifact version 2025-06-06 13:58:55 +01:00
Mike Frysinger
f4c3b351df 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-06-06 13:58:55 +01:00
Laurence McGlashan
4fb6de4cd7 Update SelectSSH.cmake 2025-06-06 13:33:22 +01:00
Florian Pircher
2a601e0d76 include: Fix code comment termination 2025-06-06 13:32:47 +01:00
Edward Thomson
ae9971347e hash: allow unsigned int != size_t in sha256
Our bundled SHA256 implementation passes a `size_t` as an `unsigned
int`. Stop doing that.
2025-06-06 13:32:35 +01: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
Edward Thomson
550cf62021 cmake: warn for not using sha1dc
git's hash algorithm is sha1dc, it is not sha1. Per Linus:

> Honestly, git has effectively already moved from SHA1 to SHA1DC.
>
> So the actual known attack and weakness of SHA1 should simply not be
> part of the discussion for the next hash. You can basically say "we're
> _already_ on the second hash, we just picked one that was so
> compatible with SHA1 that nobody even really noticed.

Warn users who try to compile with SHA1 instead of SHA1DC.
2024-12-28 09:52:42 +00:00
Edward Thomson
d85c1a1b79 Merge pull request #6985 from libgit2/ethomson/soname_revert
meta: revert soname version update
2024-12-28 09:52:21 +00:00
Edward Thomson
3aeb5bd0f6 meta: revert soname version update
Changing our SONAME / ABI version update policy without an announcement
is a breaking change. Provide time to announce a policy update.
2024-12-28 08:30:39 +00:00
Edward Thomson
dc816591d5 Merge pull request #6979 from libgit2/ethomson/v19 2024-12-28 01:57:34 +00:00
Edward Thomson
c536fcbb85 v1.9: update version numbers
Update the library's (API) version number to v1.9.0. Also update the
soname version number to 2.0, since we've had breaking ABI changes
to the library.
2024-12-28 01:00:19 +00:00
Edward Thomson
e96e250446 v1.9: update changelog 2024-12-28 01:00:19 +00:00
Edward Thomson
800a95371c Merge pull request #6984 from libgit2/ethomson/cli
CLI: introduce `init` command
2024-12-28 00:32:57 +00:00
Edward Thomson
838875eb8f Merge branch 'cmake_target' 2024-12-28 00:30:28 +00:00
Edward Thomson
ded9494954 cmake: only add package target for libgit2 itself 2024-12-28 00:26:11 +00:00
Edward Thomson
9f61001ad5 cli: improve option help 2024-12-28 00:02:25 +00:00
Edward Thomson
5350142b9b Merge pull request #6981 from libgit2/ethomson/gitlink_newline 2024-12-27 17:17:35 +00:00
Edward Thomson
5723964ca2 Merge pull request #6983 from libgit2/ethomson/template_path 2024-12-27 17:05:17 +00:00
Edward Thomson
bf5f0b5600 cli: add an init command 2024-12-27 16:50:26 +00:00
Edward Thomson
a844a6cf23 repo: put a newline on the .git link file
The `.git` file, when containing a `gitdir: ` link, should be suffixed
with a trailing newline.
2024-12-27 16:38:26 +00:00
Edward Thomson
0c27a85b41 repo: don't require option when template_path is specified
When a `template_path` is explicitly specified, don't _also_ require an
option to indicate that we should use templates. We, obviously, should.
2024-12-27 16:20:11 +00:00