Commit Graph

15596 Commits

Author SHA1 Message Date
Edward Thomson
2ecc8586f7 Merge pull request #6851 from libgit2/ethomson/url_ports 2024-07-13 16:37:11 +01:00
Edward Thomson
d58db64bc1 Merge pull request #6842 from anatol/main
Headers cleanup
2024-07-12 15:11:31 +01:00
Edward Thomson
eebaa36f73 url: track whether url explicitly specified a port
When parsing URLs, track whether the port number was explicitly
specified or not. We track this separately from whether the port is the
_default_ port. This is so that we can discern between URLs that have
the default port explicitly specified or not.

For example: scp://host:22/foo and scp://host/foo are equivalent in
terms of functionality, but are not semantically equivalent.

A user might wish to specify scp://host:22/foo in order to explicitly
ensure that we connect on port 22, which might override (for example) a
different configuration option.
2024-07-11 11:13:20 +01:00
Anatol Pomozov
1f83c4652c Remove duplicating declaration of git_email_create_from_diff()
Exactly the same function already declared in include/git2/email.h
2024-07-10 17:16:32 -07:00
Anatol Pomozov
0c39ee1b1f Use typedef type for git_odb
This makes the function signature consistent with other cases
2024-07-10 17:14:09 -07:00
Edward Thomson
53c5cdbcf5 Merge pull request #6839 from thymusvulgaris/examples-build-documentation
docs: Add instructions to build examples
2024-07-10 08:32:08 +01:00
Edward Thomson
f3518eee26 Merge pull request #6706 from u-quark/signature-use-env-vars
Use environment variables when creating signatures
2024-07-10 08:31:15 +01:00
Edward Thomson
827573abc0 Merge pull request #6834 from csware/limit-attr
Limit .gitattributes and .gitignore files to 100 MiB
2024-07-10 08:30:21 +01:00
Edward Thomson
db5b9f5fb6 Merge pull request #6846 from kcsaul/fix/setup_shallow_roots
Fix shallow root maintenance during fetch
2024-07-10 08:27:28 +01:00
Kevin Saul
9e40c1390c smart: fix shallow roots setup 2024-07-09 23:25:10 +12:00
thymusvulgaris
febc6558fe docs: Add instructions to build examples
To build the examples, they must be included in the main build
using the following command:

    cmake -DBUILD_EXAMPLES=True ..
2024-06-28 13:56:35 +01:00
Edward Thomson
585210ab21 Merge pull request #6836 from gensmusic/main
odb: conditional git_hash_ctx_cleanup in git_odb_stream
2024-06-25 11:49:28 +01:00
Edward Thomson
bfe5cb50fd Merge pull request #6837 from ehuss/stream_read_return_docs
Fix docs for git_odb_stream_read return value.
2024-06-25 10:48:17 +01:00
Eric Huss
ca1e3dbb06 Fix docs for git_odb_stream_read return value. 2024-06-22 12:59:37 -07:00
gensmusic
c3e76dd2f6 odb: conditional git_hash_ctx_cleanup in git_odb_stream
When `git_odb_stream` is a read stream, `hash_ctx` is not used.
Therefore, check if `hash_ctx` can be freed during the release.
This allows implementers of custom ODB backends to not worry about
the creation of `hash_ctx` for now.
2024-06-22 09:34:11 +08:00
Sven Strickroth
b85848e81e Limit .gitattributes and .gitignore files to 100 MiB
Git introduced this 100 MiB limit in commits 3c50032ff528 (attr: ignore
overly large gitattributes files, 2022-12-01) and e7c3d1ddba0b (dir.c:
reduce max pattern file size to 100MB, 2024-06-05).

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2024-06-17 19:24:15 +02:00
Edward Thomson
649ef1cca6 signature: add git_signature_default_from_env
People who are doing a commit expect a unified timestamp between
author and committer information when we're using the current timestamp.
Provide a single function that returns both author and committer
information so that they can have an identical timestamp when none is
specified in the environment.
2024-06-14 14:55:37 +02:00
Edward Thomson
24d9fe1339 signature: keep using signature_default internally
Making the various pieces that create commits automatically (eg, rebase)
start paying attention to the environment variables is a Big Change.
For now, this is a big change in defaults; we should treat it as
breaking. We don't move to this by default; we may add `from_env` or
`honor_env` type of API surface in the future.
2024-06-14 12:49:09 +02:00
Edward Thomson
4ce872a0fd Merge pull request #6830 from libgit2/ethomson/v1.8.2
libgit2 v1.8.2
v1.8.2 v1.8.2-rc1
2024-06-14 00:15:19 +02:00
Edward Thomson
e9d56b0b14 v1.8.2: update version numbers 2024-06-13 19:43:46 +02:00
Edward Thomson
48b63274ea v1.8.2: update changelog 2024-06-13 19:42:55 +02:00
Edward Thomson
4516ca1497 Merge pull request #6829 from libgit2/ethomson/fix_constness
Fix constness issue introduced in #6716
2024-06-13 15:44:32 +02:00
Edward Thomson
93cb09f289 Merge pull request #6816 from libgit2/ethomson/readme
README: add experimental builds to ci table
2024-06-13 15:23:53 +02:00
Edward Thomson
49d3fadfca Revert "commit: fix const declaration"
This reverts commit cf19ddc522, which
was breaking for several projects.
2024-06-13 15:20:40 +02:00
Edward Thomson
6c5520f334 Merge pull request #6811 from libgit2/ethomson/test_allocator
Introduce a stricter debugging allocator for testing
2024-05-16 11:34:07 +01:00
Edward Thomson
ee552697d5 README: update build badges and links
Use new-style links to the build information and badges, which link to the workflow filename, not the display name.
2024-05-16 11:18:41 +01:00
Edward Thomson
36f7e21ad7 Merge pull request #6817 from libgit2/ethomson/v1.8.1
libgit2 v1.8.1
v1.8.1
2024-05-16 10:58:48 +01:00
Edward Thomson
ae65dac85e v1.8.1: update changelog 2024-05-16 00:49:46 +01:00
Edward Thomson
834ec0f52f v1.8.1: update version numbers 2024-05-16 00:49:40 +01:00
Edward Thomson
0dab9d4a57 README: add experimental builds to ci table 2024-05-15 23:11:07 +01:00
Edward Thomson
eb00b48d91 fixup! alloc: introduce debug allocators 2024-05-15 22:38:33 +01:00
Edward Thomson
abedcfe71c tests: reset the allocator to the default
Instead of setting the allocator to stdalloc, just pass `NULL`, in case
we're running with the debug allocator.
2024-05-13 11:30:25 +01:00
Edward Thomson
afb2ef21bc util: don't return system allocated strings in realpath
realpath(3) _may_ allocate strings (if the second param is NULL) using
the system allocator. However, callers need an assurance that they can
free memory using git__free. If we made realpath do an allocation, then
make sure that we strdup it into our allocator's memory.

More importantly, avoid this behavior by always providing a buffer to
p_realpath invocations.
2024-05-13 11:30:25 +01:00
Edward Thomson
cfd6e0148b tests: use git__ allocator functions consistently 2024-05-13 11:30:25 +01:00
Edward Thomson
aaed67f786 alloc: introduce debug allocators
Instead of tweaking the `stdalloc` allocator when
`GIT_DEBUG_STRICT_ALLOC` is defined, actually create a debugging
allocator. This allows us to ensure that we are strict about things like
not expecting `malloc(0)` to do something useful, but we can also
introduce an excessively pedantic `realloc` implementation that _always_
creates a new buffer, throws away its original `ptr`, and overwrites the
data that's there with garbage. This may be helpful to identify places
that make assumptions about realloc.
2024-05-13 11:30:25 +01:00
Edward Thomson
c7af393a48 Merge pull request #6815 from libgit2/ethomson/signed_comparedness
tree: avoid mixed signedness comparison
2024-05-13 11:29:34 +01:00
Edward Thomson
f5c6b6ab14 Merge pull request #6814 from libgit2/ethomson/alloc
Update git_array allocator to obey strict aliasing rules
2024-05-13 11:29:25 +01:00
Edward Thomson
9a2afb7785 Merge pull request #6813 from libgit2/ethomson/opt_alloc
cli: include alloca on illumos / solaris / sunos
2024-05-13 11:29:04 +01:00
Edward Thomson
0e9eeec69a Merge pull request #6812 from libgit2/ethomson/unused-warnings
rand: avoid uninitialized loadavg warnings
2024-05-13 11:28:48 +01:00
Edward Thomson
5647f6ea7d Merge pull request #6810 from libgit2/ethomson/xdiff
xdiff: use proper free function
2024-05-13 11:28:35 +01:00
Edward Thomson
54218b5506 array: treat git_array ptrs as void *
Avoid sloppy aliasing in our (re-)allocation, which is undefined
behavior. This has been problematic before and was helped by `volatile`
(see b62a6a13b2) but that is not
technically correct, and some compilers / architectures do not
understand that `ptr` is changing due to its aliasing.

Just make `git_array_alloc` behave like `realloc`, taking a `void *` and
returning a `void *`.
2024-05-13 10:48:56 +01:00
Edward Thomson
bb3c31f327 xdiff: use proper free function 2024-05-13 10:44:06 +01:00
Edward Thomson
2fb07fd0e1 rand: avoid uninitialized loadavg warnings 2024-05-13 10:24:33 +01:00
Edward Thomson
99ba44608f tree: avoid mixed signedness comparison
Promote mode to `uint32_t` before comparing it to an `uint16_t` to avoid
mixed signed comparison warnings.
2024-05-13 10:22:44 +01:00
Edward Thomson
b1d6fd0858 cli: include alloca on illumos / solaris / sunos 2024-05-13 10:21:24 +01:00
Edward Thomson
5f796f881b Merge pull request #6808 from qaqland/fix-demo-for-each-ref
examples: fix memory leak in for-each-ref.c
2024-05-13 09:58:45 +01:00
Edward Thomson
26e0bd4ca3 Merge pull request #6806 from libgit2/ethomson/fetch_opts
remote: drop bitfields in git_remote_fetch_options
2024-05-13 09:55:39 +01:00
Edward Thomson
8791a26716 Merge pull request #6809 from csware/fix-revparse-at-at-end
Revparse: Correctly accept ref with '@' at the end
2024-05-13 09:55:04 +01:00
Sven Strickroth
60f219e80b Revparse: Correctly accept ref with '@' at the end
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2024-05-08 17:36:18 +02:00
qaqland
322ea80231 examples: fix memory leak in for-each-ref.c 2024-05-08 11:08:26 +08:00