|
19ec5923
|
2022-02-07T09:29:40
|
|
push: Prepare pack before sending pack header.
For large pushes, preparing the pack can take a while. Currently we
send the pack header first, followed by preparing the pack and then
finally sending the pack. Unfortunately github.com will terminate
a git-receive-pack command over http if it is idle for more than 10
seconds. This is easily exceeded for a large push, and so the push is
rejected with a Broken Pipe error.
This patch moves the pack preparation ahead of sending the pack header,
so that the timeout is avoided.
prepare_pack() can be called multiple times but will only do the work
once, so the original PREPARE_PACK call inside git_packbuilder_foreach()
remains.
|
|
12b53eb0
|
2021-12-04T20:00:41
|
|
Merge pull request #6128 from libgit2/ethomson/object_validation
Introduce `git_object_rawcontent_is_valid`
|
|
fc1a3f45
|
2021-11-29T13:36:36
|
|
object: return GIT_EINVALID on parse errors
Return `GIT_EINVALID` on parse errors so that direct callers of parse
functions can determine when there was a failure to parse the object.
The object parser functions will swallow this error code to prevent it
from propagating down the chain to end-users. (`git_merge` should not
return `GIT_EINVALID` when a commit it tries to look up is not valid,
this would be too vague to be useful.)
The only public function that this affects is
`git_signature_from_buffer`, which is now documented as returning
`GIT_EINVALID` when appropriate.
|
|
9f03ebd1
|
2021-11-29T13:44:42
|
|
object: introduce a raw content validation function
Users may want to validate raw object content; provide them a function
to do so.
|
|
6fdb1b2f
|
2021-11-30T21:09:57
|
|
Merge pull request #6122 from libgit2/ethomson/cleanup
Minor code cleanups
|
|
f9c4dc10
|
2021-11-22T11:23:50
|
|
Merge pull request #6106 from ammgws/fixtemplateerr
Fix repo init when template dir is non-existent
|
|
3461aaf7
|
2021-11-22T10:29:29
|
|
repo: minor formatting fix
|
|
84083dcc
|
2021-11-19T08:48:08
|
|
cmake: use CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR
Instead of using the project-specific `libgit2_SOURCE_DIR` and
`libgit2_BINARY_DIR` variables, use `CMAKE_SOURCE_DIR` and
`CMAKE_BINARY_DIR`.
|
|
adcf638c
|
2021-11-21T21:34:17
|
|
filebuf: use hashes not oids
The filebuf functions should use hashes directly, not indirectly
using the oid functions.
|
|
91365fd8
|
2021-11-22T09:02:38
|
|
sha1: tests should use hashes, not oid computation
The tests that examine sha1 behavior (including collision detection)
should test against the hash functionality directly, not indirectly
using the oid functions.
|
|
fc42c28e
|
2021-11-19T09:36:03
|
|
util: don't include unnecessary system libraries
Remove some unnecessary includes from utility code.
|
|
ea62f546
|
2021-11-14T16:41:11
|
|
utf8: include `utf8.h` in tests
|
|
19743830
|
2021-11-19T08:17:28
|
|
Merge pull request #6121 from libgit2/ethomson/date
util: minor cleanup and refactoring to the date class
|
|
add30a83
|
2021-11-18T12:36:25
|
|
date: rfc2822 formatting uses a `git_buf` instead of a static string
|
|
b2c40314
|
2021-11-18T12:19:32
|
|
date: make it a proper `git_date` utility class
Instead of `git__date`, just use `git_date`.
|
|
1604be06
|
2021-11-17T08:54:38
|
|
Merge pull request #6120 from libgit2/ethomson/cmake_test
cmake: re-enable WinHTTP
|
|
1b8d14ac
|
2021-11-17T08:25:56
|
|
cmake: use WINHTTP when USE_WINHTTP is specified
|
|
4a54d8e3
|
2021-11-17T07:27:39
|
|
cmake: enable testing at the top level
Ensure that we `enable_testing()` at the top-level CMakeLists.txt or
else we'll need to navigate within the build directory to the correct
place in the hierarchy to run `ctest`. Now we can `ctest` at the
top-level again.
|
|
7a15213e
|
2021-11-16T23:42:09
|
|
Merge pull request #6119 from libgit2/ethomson/tag_valid
tag: set validity to 0 by default
|
|
6b2ea909
|
2021-11-16T23:21:29
|
|
tag: set validity to 0 by default
`git_tag_name_is_valid` needs to set validity to 0 when it
short-circuits.
|
|
86685f8f
|
2021-11-16T17:10:08
|
|
cmake: better explain why headertests exists
|
|
7dcc29fc
|
2021-10-22T22:51:59
|
|
Make enum in src,tests and examples C90 compliant by removing trailing comma.
|
|
43d9f0e3
|
2021-10-22T22:39:10
|
|
ntmlclient: make enum C90 compliant by removing trailing comma
|
|
38c34498
|
2021-10-03T00:12:52
|
|
Make enum in includes C90 compliant by removing trailing comma.
|
|
5221e185
|
2021-10-02T23:54:14
|
|
Add target for testing libgit2 headers
|
|
23c5c315
|
2021-11-14T08:42:12
|
|
Merge pull request #6114 from libgit2/ethomson/cmake5
cmake: further refactorings
|
|
2c154145
|
2021-11-11T23:09:44
|
|
cmake: move sha1 source selection into CMakeLists.txt
The select hashes module selects the hash; the CMakeLists.txt selects
the files to implement it.
|
|
c7f6ecb3
|
2021-11-11T22:54:14
|
|
cmake: use a string not a boolean for LIBGIT2_FILENAME
|
|
395b3dc4
|
2021-11-11T22:10:51
|
|
cmake: refactor global variables
Update the global variables `LIBGIT2_OBJECTS` to
`LIBGIT2_DEPENDENCY_OBJECTS` for clarity and consistency.
|
|
c3fec456
|
2021-11-11T22:37:36
|
|
cmake: reformat modules
Apply the standard project cmake formatting to the modules.
|
|
b608af6c
|
2021-11-14T07:23:01
|
|
Merge pull request #6116 from lhchavez/drop-volatile-qualifier-in-atomic-exchange
|
|
03132b36
|
2021-11-14T07:22:24
|
|
Merge pull request #6115 from lhchavez/fix-indentation-threadstate
|
|
5675312e
|
2021-11-14T02:27:10
|
|
Fix a gcc 11 warning in src/thread.h
When building under gcc 11, there is a warning about an incompatible pointer
type, since
[`__atomic_exchange`](https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html)
does not take `volatile` pointers:
```
In file included from ../src/common.h:81,
from ../src/transports/winhttp.c:8:
../src/thread-utils.h: In function ‘git___swap’:
../src/thread-utils.h:168:9: warning: argument 3 of ‘__atomic_exchange’ discards ‘volatile’ qualifier [-Wincompatible-pointer-types]
168 | __atomic_exchange(ptr, &newval, &foundval, __ATOMIC_SEQ_CST);
| ^~~~~~~~~~~~~~~~~
```
This change drops the `volatile` qualifier so that the pointer type matches
what `__atomic_exchange` expects.
|
|
0c4d24da
|
2021-11-14T02:24:39
|
|
Fix a gcc 11 warning in src/threadstate.c
When building under gcc 11, there is a warning about a misaligned guard clause
because there were mixed spaces and tabs:
```
[128/634] Building C object src/CMakeFiles/git2internal.dir/threadstate.c.o
../src/threadstate.c: In function ‘threadstate_dispose’:
../src/threadstate.c:39:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
39 | if (threadstate->error_t.message != git_str__initstr)
| ^~
../src/threadstate.c:41:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
41 | threadstate->error_t.message = NULL;
| ^~~~~~~~~~~
../src/threadstate.c: At top level:
```
This change indents the code with tabs for consistency with the rest of the
code, which makes the warning go away.
|
|
bc0d1ad2
|
2021-11-05T03:08:43
|
|
tests: try to init with non-existent template path
|
|
709b1b62
|
2021-11-05T02:28:37
|
|
repository: do not copy templates if dir nonexistent
This mimics the behaviour of git which just prints a
warning and continues with the repo initialisation.
|
|
043f3123
|
2021-11-11T18:21:35
|
|
Merge pull request #6113 from libgit2/ethomson/cmake3
Add missing-declarations warning globally
|
|
4a6ef5a4
|
2021-11-11T17:04:24
|
|
cmake: move missing-declarations warning to top-level
We should enforce declarations throughout the code-base, including
examples, fuzzers and tests, not just in the `src` tree.
|
|
8d2b3110
|
2021-11-11T19:58:49
|
|
tests: include function declarations
|
|
bfdc0971
|
2021-11-11T13:32:00
|
|
test: correct test names
|
|
ca14942e
|
2021-11-11T13:28:08
|
|
tests: declare functions statically where appropriate
|
|
3f024b6d
|
2021-11-11T12:57:44
|
|
clar: declare summary functions as static
|
|
eabbee04
|
2021-11-11T12:48:19
|
|
example: declare print_usage function
|
|
8be22614
|
2021-11-11T12:47:02
|
|
examples: remove unused function
|
|
2374ba8d
|
2021-11-11T17:15:47
|
|
fuzzers: declare static functions as static
|
|
489aec44
|
2021-11-11T12:33:14
|
|
fuzzers: declare standalone functions
|
|
0429894e
|
2021-11-11T12:28:07
|
|
tests: declare trace handler as static
|
|
49f03c03
|
2021-11-11T16:53:33
|
|
tests: include test declarations for old gcc
Older versions of gcc do not believe that we've adequately declared our
test functions. Include `clar_suite.h` conditionally for those old
versions. Do not do this on newer compilers to avoid unnecessary
recompilation of the entire suite when we add or remove a test function.
|
|
cf522050
|
2021-11-11T16:24:37
|
|
clar: emit `clar_suite.h` with test declarations
We may want to have test function declarations; produce a header file
with (only) the test declarations. Update clar to avoid overwriting the
file unnecessarily to avoid bumping timestamps and potentially
recompiling unnecessarily.
|
|
7687948a
|
2021-11-11T16:13:38
|
|
Merge pull request #6112 from libgit2/ethomson/cmake3
cmake refactorings
|
|
42205e72
|
2021-11-11T16:09:49
|
|
Merge pull request #6111 from libgit2/ethomson/str_free
str: git_str_free is never a function
|
|
4e84ddd5
|
2021-11-10T21:59:46
|
|
cmake: refactor zlib selection
Move zlib selection into its own cmake module.
|
|
83fa5480
|
2021-11-10T21:58:12
|
|
cmake: refactor WinHTTP selection
Move WinHTTP selection into its own cmake module.
|
|
e35a22a0
|
2021-11-10T21:55:23
|
|
cmake: refactor libssh2 selection
Move SSH selection into its own cmake module.
|
|
f0cb3788
|
2021-11-10T21:51:55
|
|
cmake: refactor regex selection
Move regex selection into its own cmake module.
|
|
de178d36
|
2021-11-10T21:49:20
|
|
cmake: refactor http_parser selection
Move http_parser selection into its own cmake module.
|
|
16b6e3a9
|
2021-11-10T21:33:28
|
|
cmake: HTTP_Parser is now HTTPParser
|
|
19e99de0
|
2021-11-10T08:14:11
|
|
cmake: qsort detection in features.h
|
|
6c00fcb7
|
2021-11-10T17:32:41
|
|
cmake: USE_SSH is not on by default
|
|
789ab915
|
2021-11-10T21:02:42
|
|
cmake: standardize USE_WINHTTP
WinHTTP can now be disabled with `USE_WINHTTP=OFF` instead of
`WINHTTP=OFF` to better support the other cmake semantics.
|
|
9324d16e
|
2021-11-06T16:14:47
|
|
cmake: standardize USE_THREADS and USE_NSEC
Threading can now be disabled with `USE_THREADS=OFF` instead of
`THREADSAFE=OFF` to better support the other cmake semantics.
Nanosecond support is the default _if_ we can detect it. This should be
our default always - like threads - and people can opt out explicitly.
|
|
d3a7a352
|
2021-11-06T16:44:07
|
|
cmake: move test enablement into test cmake
|
|
207beff5
|
2021-11-06T16:43:04
|
|
cmake: reorganize file
|
|
4d2a6839
|
2021-11-06T16:38:57
|
|
cmake: move fuzzer args to the fuzzer's cmake
|
|
7b527c12
|
2021-11-06T16:38:11
|
|
cmake: move deprecation definition to src/
There's no need to add the deprecation at the top-level. Our tests add
deprecation explicitly.
|
|
9f37457e
|
2021-11-06T16:23:03
|
|
cmake: move cflag defaults into a separate module
|
|
08047ca0
|
2021-11-11T19:56:31
|
|
str: git_str_free is never a function
|
|
ceddeed8
|
2021-11-11T15:20:50
|
|
Merge pull request #6104 from libgit2/ethomson/path
path: refactor utility path functions
|
|
9ab351c0
|
2021-11-11T15:14:59
|
|
Merge pull request #6107 from joshtriplett/refresh-handling
Support checking for object existence without refresh
|
|
dfd5b32f
|
2021-11-11T15:10:37
|
|
Merge pull request #6109 from joshtriplett/document-odb-race-free
Document that `git_odb` is thread-safe
|
|
644c763b
|
2021-11-11T00:30:40
|
|
Document that `git_odb` is thread-safe
Commit 4ae41f9c639d246d34dac89c3f1d9451c9cfa8d3 made `git_odb`
race-free, and added internal locking. Update `docs/threading.md`
accordingly, so that APIs built atop libgit2 (e.g. language bindings)
can count on this.
|
|
1a8b2922
|
2021-11-09T14:15:32
|
|
win32: include correct path header
|
|
1217c5b2
|
2021-11-01T21:12:23
|
|
fs_path: remove now-unused validation functions
|
|
62251409
|
2021-11-01T21:09:17
|
|
fs_path: add length with suffix validation
|
|
91246ee5
|
2021-11-01T20:14:34
|
|
path: use new length validation functions
|
|
1728e27c
|
2021-11-01T18:19:56
|
|
path: length validation respecting core.longpaths
Teach `git_path_is_valid` to respect `core.longpaths`. Add helper
methods to validate length and set the error message appropriately.
|
|
315a43b2
|
2021-11-01T17:37:06
|
|
path: introduce `git_path_str_is_valid`
Add a `git_str` based validity check; the existing `git_path_is_valid`
defers to it.
|
|
ebacd24c
|
2021-11-01T13:58:18
|
|
fs_path: add long path validation on windows
|
|
dd748dbe
|
2021-11-01T13:04:40
|
|
fs_path: make empty component validation optional
|
|
bef02d3e
|
2021-11-01T10:57:28
|
|
fs_path: introduce `str_is_valid`
Provide a mechanism for users to limit the number of characters that are
examined; `git_fs_path_str_is_valid` and friends will only examine up to
`str->size` bytes.
`git_fs_path_is_valid` delegates to these new functions by passing
`SIZE_MAX` (instead of doing a `strlen`), which is a sentinel value
meaning "look for a NUL terminator".
|
|
63e36c53
|
2021-11-01T09:34:32
|
|
path: `validate` -> `is_valid`
Since we're returning a boolean about validation, the name is more
properly "is valid".
|
|
434a4610
|
2021-11-01T09:31:32
|
|
fs_path: `validate` -> `is_valid`
Since we're returning a boolean about validation, the name is more
properly "is valid".
|
|
95117d47
|
2021-10-31T09:45:46
|
|
path: separate git-specific path functions from util
Introduce `git_fs_path`, which operates on generic filesystem paths.
`git_path` will be kept for only git-specific path functionality (for
example, checking for `.git` in a path).
|
|
44ec8b5c
|
2021-11-09T09:38:53
|
|
Merge pull request #6108 from libgit2/ethomson/docs_ci
ci: only update docs on push
|
|
51f6f15d
|
2021-11-09T09:03:06
|
|
ci: only update docs on push
Only update the documentation on a `push`. We were previously updating the documentation only when not in a `pull_request`, which meant that we would push documentation updates in manual build triggers.
|
|
f45ff6c9
|
2021-11-08T17:33:35
|
|
Omit trailing comma on enum
To accommodate less capable compilers.
Co-authored-by: Peter Pettersson <85582231+boretrk@users.noreply.github.com>
|
|
94cb060c
|
2021-11-08T14:54:09
|
|
Add tests for ODB refresh
Add optional refreshing in the fake backend, and count the number of
refresh calls if enabled.
|
|
81662d43
|
2021-11-08T14:48:45
|
|
Support checking for object existence without refresh
Looking up a non-existent object currently always invokes
`git_odb_refresh`. If looking up a large batch of objects, many of which
may legitimately not exist, this will repeatedly refresh the ODB to no
avail.
Add a `git_odb_exists_ext` that accepts flags controlling the ODB
lookup, and add a flag to suppress the refresh. This allows the user to
control if and when they refresh (for instance, refreshing once before
starting the batch).
|
|
3993e9ae
|
2021-11-08T14:00:09
|
|
Update documentation for ODB backend refresh logic
Commit b1a6c316a6070fac4ab1ec5792979838f7145c39 moved auto-refresh into
the pack backend, and added a comment accordingly. Commit
43820f204ea32503b4083e3b6b83f30a0a0031c9 moved auto-refresh back *out*
of backends into the ODB layer, but didn't update the comment.
|
|
358a60e1
|
2021-10-28T11:27:28
|
|
Merge pull request #6100 from mkhl/tests/instead-of-clar
libgit2_clar is now libgit2_tests
|
|
f66e7f36
|
2021-10-28T10:25:09
|
|
libgit2_clar is now libgit2_tests
in #6083 the test runner was renamed to libgit2_tests,
but not all references to the old name were updated.
this change changes all of them to use the new name.
|
|
9b04a307
|
2021-10-18T08:54:36
|
|
Merge pull request #6084 from libgit2/ethomson/cmake
cmake: cleanups and consistency
|
|
52693ab4
|
2021-09-26T23:11:13
|
|
cmake: stylistic refactoring
Ensure that we always use lowercase function names, and that we do not
have spaces preceding open parentheses, for consistency.
|
|
e1be28c7
|
2021-09-26T22:02:04
|
|
cmake: remove unused STDCALL option
The `STDCALL` option was removed; remove the (unreachable) error
message.
|
|
8507bf81
|
2021-09-26T21:54:08
|
|
trace: always enabled
There's no need to make tracing opt-in; it should always be included.
|
|
780faa41
|
2021-09-26T21:51:16
|
|
cmake: allow USE_ICONV on any Unix
|
|
7f5b0f0c
|
2021-09-26T21:50:19
|
|
cmake: allow ENABLE_REPRODUCIBLE_BUILDS on macOS
macOS may support ENABLE_REPRODUCIBLE_BUILDS, allow users to opt-in to
it. (Especially since ENABLE_REPRODUCIBLE_BUILDS is not the default.)
|
|
a89db0e7
|
2021-10-17T17:15:41
|
|
Merge pull request #6083 from libgit2/ethomson/clar_no_more
|
|
4e14d4c6
|
2021-09-26T22:06:49
|
|
cmake: BUILD_CLAR is now BUILD_TESTS
Nobody knows what CLAR is. The test building option should be
`BUILD_TESTS`.
|
|
e61abdce
|
2021-10-17T10:20:46
|
|
Merge pull request #6078 from libgit2/ethomson/gitstr
`git_buf`: now a public-only API (`git_str` is our internal API)
|