Log

Author Commit Date CI Message
Edward Thomson 0a4255e4 2020-06-06T16:30:27 Update main.yml
Edward Thomson 06e0abe1 2020-06-06T16:22:25 Update main.yml
Edward Thomson fd6997af 2020-06-06T16:21:07 Update main.yml
Edward Thomson 91f02a8a 2020-06-06T16:20:35 Update main.yml
Edward Thomson 8d8cfee9 2020-06-06T16:16:30 Update main.yml
Edward Thomson 39d12f1c 2020-06-06T16:14:59 Update main.yml
Edward Thomson 872cc3dc 2020-06-06T16:13:38 Update main.yml
Edward Thomson eb7e17ee 2020-06-06T16:12:18 Update main.yml
Edward Thomson aa0b1d19 2020-06-06T16:08:00 Update main.yml
Edward Thomson 254108b0 2020-06-06T15:53:42 Update main.yml
Edward Thomson cef3585b 2020-06-06T15:48:00 Update main.yml
Edward Thomson e300547b 2020-06-06T15:37:42 Update main.yml
Edward Thomson 580c76ed 2020-06-06T15:35:58 Update main.yml
Edward Thomson 3b6fad6d 2020-06-06T15:33:19 Update main.yml
Edward Thomson 15fa1a49 2020-06-06T15:14:21 Update main.yml
Edward Thomson 340de10f 2020-06-06T15:03:21 Update main.yml
Edward Thomson cdeff885 2020-06-06T14:53:07 Update main.yml
Edward Thomson 10d5987c 2020-06-06T14:45:07 Create main.yml
Edward Thomson c708e5e5 2020-06-05T14:11:34 Merge pull request #5541 from libgit2/ethomson/clar_tap clar: add tap output option
Edward Thomson cad7a1ba 2020-06-05T08:42:38 clar: include the function name
Edward Thomson b4290518 2020-06-05T07:53:32 Merge pull request #5545 from libgit2/ethomson/diff_parse diff::parse: don't include `diff.h`
Edward Thomson 06d69dfc 2020-05-01T12:39:48 diff::parse: don't include `diff.h` We don't call any internal functions in the test; we don't need to include `../src/diff.h`.
Patrick Steinhardt 2f8d0cf2 2020-06-04T12:37:48 Merge pull request #5543 from libgit2/ethomson/release_script_typo release script: fix typo
Edward Thomson b79f7d38 2020-06-04T09:49:38 release script: fix typo
Edward Thomson f7250cc3 2020-06-04T07:23:15 clar: add tap output
Edward Thomson 691315e6 2020-06-03T15:47:42 clar: add an output abstraction layer Add an output abstraction layer, with a single output format, "clap", the clar protocol, which is the current output format for clar.
Edward Thomson 0187f36a 2020-06-03T15:22:44 clar: parse arguments before printing the header We want to parse arguments before we start printing any output; the arguments themselves may impact the way we display that output.
Patrick Steinhardt 86b85492 2020-06-03T15:40:37 Merge pull request #5537 from libgit2/ethomson/clar_exactmatch tests: offer exact name matching with a `$` suffix
Edward Thomson 107bf1f4 2020-06-03T11:47:13 clar: print indirection
Patrick Steinhardt 53a8f463 2020-06-03T07:40:59 Merge pull request #5536 from libgit2/ethomson/http httpclient: support googlesource
Edward Thomson 6de8aa7f 2020-06-02T12:21:22 Merge pull request #5532 from joshtriplett/pack-default-path git_packbuilder_write: Allow setting path to NULL to use the default path
Edward Thomson 22f9a0fc 2020-06-02T12:12:41 Merge pull request #5531 from joshtriplett/mempack-threads mempack: Use threads when building the pack
Edward Thomson 0d3ce2ac 2020-06-02T10:23:41 offer exact name matching with a `$` suffix When using `-s` to specify a particular test, it will do a prefix match. Thus, `-sapply::both::rename_a_to_b_to_c` will match both a test named `test_apply_both__rename_a_to_b_to_c` and a test that begins with that name, like `test_apply_both__rename_a_to_b_to_c_exact`. Permit a trailing `$` to `-s` syntax. This allows a user to specify `-sapply::both::rename_a_to_b_to_c$` to match _only_ the `test_apply_both__rename_a_to_b_to_c` function. We already filter to ensure that the given prefix matches the current test name. Also ensure that the length of the test name matches the length of the filter, sans trailing `$`.
Edward Thomson d4b953f8 2020-06-02T09:26:11 Merge pull request #5528 from libgit2/ethomson/clar_internal clar: use internal functions instead of /bin/cp and /bin/rm
Edward Thomson 2a2c5b40 2020-05-23T15:57:48 clar: remove unused shell_out function
Edward Thomson ee9e9163 2020-05-23T15:56:29 clar: remove files internally instead of /bin/rm Similar to how clar has used `/bin/cp` to copy files, it's used `/bin/rm` to remove them. This has similar deficiencies; meaning that leaks is noisy and it's slow. Move it to an internal function.
Edward Thomson d03fd331 2020-05-23T15:42:51 clar: copy files with sendfile on linux
Edward Thomson 8df4f519 2020-05-23T15:04:54 clar: copy files internally instead of /bin/cp clar has historically shelled out to `/bin/cp` to copy test fixtures into a sandbox. This has two deficiencies: 1. It's slower than simply opening the source and destination and copying them in a read/write loop. On my Mac, the `/bin/cp` based approach takes ~2:40 for a full test pass. Using a read/write loop to copy the files ourselves takes ~1:50. 2. It's noisy. Since the leak detector follows fork/exec, we'll end up running the leak detector on `/bin/cp`. This would be fine, except that the leak detector spams the console on startup and shutdown, so it adds a _lot_ of additional information to the test runs that is useless. By not forking and using this internal system, we see much less output.
Edward Thomson 849f371e 2020-06-02T00:29:34 Merge pull request #5535 from libgit2/ethomson/strarray strarray refactoring
Edward Thomson 04c7bdb4 2020-06-01T22:44:14 httpclient: clear the read_buf on new requests The httpclient implementation keeps a `read_buf` that holds the data in the body of the response after the headers have been written. We store that data for subsequent calls to `git_http_client_read_body`. If we want to stop reading body data and send another request, we need to clear that cached data. Clear the cached body data on new requests, just like we read any outstanding data from the socket.
Edward Thomson aa8b2c0f 2020-06-01T23:53:55 httpclient: don't read more than the client wants When `git_http_client_read_body` is invoked, it provides the size of the buffer that can be read into. This will be set as the parser context's `output_size` member. Use this as an upper limit on our reads, and ensure that we do not read more than the client requests.
Edward Thomson 5eb48a14 2020-05-29T13:17:39 strarray: deprecate git_strarray_copy We should not be in the business of copying strings around for users. We either return a strarray that can be freed, or we take one (and do not mutate it).
Edward Thomson 51eff5a5 2020-05-29T13:13:19 strarray: we should `dispose` instead of `free` We _dispose_ the contents of objects; we _free_ objects (and their contents). Update `git_strarray_free` to be `git_strarray_dispose`. `git_strarray_free` remains as a deprecated proxy function.
Edward Thomson a9746b30 2020-05-29T11:21:55 strarray: move to its own file
Edward Thomson 570f0340 2020-06-01T19:10:38 httpclient: read_body should return 0 at EOF When users call `git_http_client_read_body`, it should return 0 at the end of a message. When the `on_message_complete` callback is called, this will set `client->state` to `DONE`. In our read loop, we look for this condition and exit. Without this, when there is no data left except the end of message chunk (`0\r\n`) in the http stream, we would block by reading the three bytes off the stream but not making progress in any `on_body` callbacks. Listening to the `on_message_complete` callback allows us to stop trying to read from the socket when we've read the end of message chunk.
Edward Thomson b7bdb071 2020-05-30T15:21:48 online::clone: test a googlesource URL Google Git (googlesource.com) behaves differently than git proper. Test that we can communicate with it.
Patrick Steinhardt 629515a8 2020-06-01T15:06:29 Merge pull request #5481 from pks-t/pks/cmake-cleanups CMake cleanups
Patrick Steinhardt 17641f1f 2020-06-01T15:05:51 Merge pull request #5526 from libgit2/ethomson/poolinit git_pool_init: allow the function to fail
Edward Thomson 0f35efeb 2020-05-23T10:15:51 git_pool_init: handle failure cases Propagate failures caused by pool initialization errors.
Patrick Steinhardt 511fb9e6 2020-04-03T22:53:23 cmake: always disable deprecation-sync warnings We currently disable deprecation synchronization warnings in case we're building with Clang. We check for Clang by doing a string comparison on the compiler identification, but this seems to have been broken by an update in macOS' image as the compiler ID has changed to "AppleClang". Let's just unconditionally disable this warning on Unix platforms. We never add the deprecated attribute anyway, so the warning doesn't help us at all.
Patrick Steinhardt 3956679c 2020-04-03T20:08:02 cmake: remove policies The `CMAKE_MINIUM_REQUIRE()` function not only sets up the minimum required CMake version of a project, but it will also at the same time set the CMake policy version. In effect this means that all policies that have been introduced before the minimum CMake version will be enabled automatically. When updating our minimum required version ebabb88f2 (cmake: update minimum CMake version to v3.5.1, 2019-10-10), we didn't remove any of the policies we've been manually enabling. The newest CMake policy we've been enabling is CMP0054, which was introduced back in CMake v3.1. As a result, we can now just remove all manual calls to `CMAKE_POLICY()`.
Patrick Steinhardt 2e7d4579 2020-04-03T19:59:39 cmake: remove option to add profiling flags We currently have an option that adds options for profiling to both our CFLAGS and LDFLAGS. Having such flags behind various build options is not really sensible at all, since users should instead set up those flags via environment variables supported by CMake itself. Let's remove this option.
Patrick Steinhardt 2551b1b0 2020-04-03T19:53:35 cmake: remove support for creating tags We currently have support for generating tags via ctags as part of our build system. We aren't really in the place of supporting any tooling that exists apart from the actual build environment, as doing so adds additional complexity and maintenance burden to our build instructions. This is in fact nicely demonstrated by this particular option, as it hasn't been working anymore since commit e5c9723d0 (cmake: move library build instructions into subdirectory, 2017-06-30). As a result, this commit removes support for building CTags
Patrick Steinhardt bc02bcd9 2020-04-03T19:51:22 cmake: move modules into the "cmake/" top level dir Our custom CMake module currently live in "cmake/Modules". As the "cmake/" directory doesn't contain anything except the "Modules" directory, it doesn't really make sense to have the additional intermediate directory. So let's instead move the modules one level up into the "cmake/" top level directory.
Patrick Steinhardt 172a2886 2020-06-01T14:04:15 Merge pull request #5529 from libgit2/ethomson/difftest diff::workdir: actually test the buffers
Patrick Steinhardt 1bbdf15d 2020-06-01T13:57:12 Merge pull request #5527 from libgit2/ethomson/config_unreadable Handle unreadable configuration files
Edward Thomson 9df69223 2020-05-23T11:42:19 config: test that unreadable files are treated as notfound
Wil Shipley d1409f48 2020-05-06T19:57:07 config: ignore unreadable configuration files Modified `config_file_open()` so it returns 0 if the config file is not readable, which happens on global config files under macOS sandboxing (note that for some reason `access(F_OK)` DOES work with sandboxing, but it is lying). Without this read check sandboxed applications on macOS can not open any repository, because `config_file_read()` will return GIT_ERROR when it cannot read the global /Users/username/.gitconfig file, and the upper layers will just completely abort on GIT_ERROR when attempting to load the global config file, so no repositories can be opened.
Patrick Steinhardt 89ddd0fc 2020-06-01T13:19:01 Merge pull request #5533 from pjw91/fix-index-write Make git_index_write() generate valid v4 index
Patrick Wang 1a899008 2020-05-26T20:36:13 tests: index::version: write v4 index: re-open repo to read written v4 index The `git_index_free()` merely decrement the reference counter from 2 to 1, and does not "free" the index. Thus, the following `git_repository_index()` merely increase the counter to 2, instead of read index from disk. The written index is not read and parsed, which makes this test case effectively becomes a no-op.
Patrick Wang 8c96d56d 2020-05-26T04:53:09 index: write v4: bugfix: prefix path with strip_len, not same_len According to index-format.txt of git, the path of an entry is prefixed with N, where N indicates the length of bytes to be stripped.
Josh Triplett 5278a006 2020-05-23T16:07:54 git_packbuilder_write: Allow setting path to NULL to use the default path If given a NULL path, write to the object path of the repository. Add tests for the new behavior.
Josh Triplett 0bc091dd 2020-05-23T15:35:38 git_packbuilder_write: Unify cleanup path Clean up and return via a single label, to avoid duplicate error handling before each return, and to make it easier to extend the set of cleanups needed.
Josh Triplett 30285a3c 2020-05-23T15:04:19 mempack: Use threads when building the pack The mempack ODB backend creates a packbuilder internally to write out a pack; call git_packbuilder_set_threads on that packbuilder, to use threads for packing if available.
Edward Thomson 3414d470 2020-05-23T16:27:56 diff::workdir: actually test the buffers The static test data is erroneously initialized with a length of 0 for three of the strings. This means the tests are not actually examining those strings. Provide the length.
Edward Thomson 27cb4e0e 2020-05-23T11:02:07 Merge pull request #5522 from pks-t/pks/openssl-cert-memleak OpenSSL certificate memory leak
Edward Thomson abfdb8a6 2020-05-23T10:15:37 git_pool_init: return an int Let `git_pool_init` return an int so that it could fail.
Edward Thomson e4bdba56 2020-05-23T09:57:22 Merge pull request #5515 from pks-t/pks/flaky-checkout-test tests: checkout: fix flaky test due to mtime race
Edward Thomson 3b7b4d27 2020-05-23T09:40:55 Merge pull request #5523 from libgit2/pks/cmake-sort-reproducible-builds cmake: Sort source files for reproducible builds
Edward Thomson f88e12db 2020-05-23T09:35:53 checkout::index: free the index
Patrick Steinhardt 3f201f75 2020-05-16T13:48:04 checkout: fix file being treated as unmodified due to racy index When trying to determine whether a file changed, we try to avoid heavy operations by fist taking a look at the index, seeing whether the index entry is modified already. This doesn't seem to cut it, though, as we currently have the racy checkout::index::can_disable_pathspec_match test case: sometimes the files get restored to their original contents, sometimes they aren't. The issue is caused by a racy index [1]: in case we modify a file, add it to the index and then modify it again in-place without changing its file, then we may end up with a modified file that has the same stat(3P) info as we've currently got it in its corresponding index entry. The mitigation for this is to treat files with the same mtime as the index are treated as racily modified. We already have this logic in place for the index, but not when doing a checkout. Fix the issue by only consulting the index entry in case it has an older mtime as the index. Previously, the following script reliably had at least 20 failures, while now there is no failure to be observed anymore: ```bash j=0 for i in $(seq 100) do if ! ./libgit2_clar -scheckout::index::can_disable_pathspec_match >/dev/null then j=$(($j + 1)) fi done echo "Failures: $j" ``` [1]: https://git-scm.com/docs/racy-git
Patrick Steinhardt 915f8860 2020-05-16T14:00:11 tests: checkout: fix stylistic issues and static variable The test case checkout::index::can_disable_pathspec_match has some shortcomings when it comes to coding style, which didn't fit our own coding style. Furthermore, it had an unnecessary static local variable. The test has been refactored to address these issues.
Patrick Steinhardt b85eefb4 2020-05-15T19:52:40 cmake: Sort source files for reproducible builds We currently use `FILE(GLOB ...)` in most places to find source and header files. This is problematic in that the order of files returned depends on the operating system's directory iteration order and may thus not be deterministic. As a result, we link object files in unspecified order, which may cause the linker to emit different code across runs. Fix this issue by sorting all code used as input to the libgit2 library to improve the reliability of reproducible builds.
Patrick Steinhardt b43a9e66 2020-05-15T17:46:24 streams: openssl: fix memleak due to us not free'ing certs When creating a `git_cert` from the OpenSSL X509 certificate of a given stream, we do not call `X509_free()` on the certificate, leading to a memory leak as soon as the certificate is requested e.g. by the certificate check callback. Fix the issue by properly calling `X509_free()`.
Edward Thomson b7b872f5 2020-05-12T22:39:27 Merge pull request #5517 from libgit2/pks/futils-symlink-args futils: fix order of declared parameters for `git_futils_fake_symlink`
Patrick Steinhardt a2eca682 2020-05-12T21:35:07 futils: fix order of declared parameters for `git_futils_fake_symlink` While the function `git_futils_fake_symlink` is declared with arguments `new, old`, the implementation uses the reverse order `old, new`. Let's fix the ordering issues to be `new, old` for both, which matches what symlink(3P) has. While at it, we also rename these parameters: `old` and `new` doesn't really make a lot of sense in the context of symlinks, which is why this commit renames them to be called `target` and `path`.
Patrick Steinhardt 3f90fcd6 2020-05-12T21:22:48 Merge pull request #5516 from suhaibmujahid/update-release Check the version in package.json
Suhaib Mujahid f1c1458c 2020-05-12T10:55:14 feat: Check the version in package.json
Edward Thomson 896abfc8 2020-05-12T11:14:10 Merge pull request #5513 from libgit2/pks/tests-fix-32-bit-formatter tests: merge: fix printf formatter on 32 bit arches
Patrick Steinhardt 0cf9b666 2020-05-12T11:41:44 tests: merge: fix printf formatter on 32 bit arches We currently use `PRIuMAX` to print an integer of type `size_t` in merge::trees::rename::cache_recomputation. While this works just fine on 64 bit arches, it doesn't on 32 bit ones. As a result, our nightly builds on x86 and arm32 fail. Fix the issue by using `PRIuZ` instead.
Edward Thomson 51a2bc43 2020-05-12T08:22:31 Merge pull request #5511 from suhaibmujahid/patch-1 Update package.json
Edward Thomson 045efb7b 2020-05-11T21:20:52 Merge pull request #5509 from libgit2/ethomson/assert_macros Introduce GIT_ASSERT macros
Edward Thomson 31ddf163 2020-05-11T21:06:42 Merge pull request #5512 from A-Ovchinnikov-mx/patch-1 README.md: Add instructions for building in MinGW environment
Edward Thomson cbae1c21 2020-04-01T22:12:07 assert: allow non-int returning functions to assert Include GIT_ASSERT_WITH_RETVAL and GIT_ASSERT_ARG_WITH_RETVAL so that functions that do not return int (or more precisely, where `-1` would not be an error code) can assert. This allows functions that return, eg, NULL on an error code to do that by passing the return value (in this example, `NULL`) as a second parameter to the GIT_ASSERT_WITH_RETVAL functions.
Edward Thomson a95096ba 2020-01-12T10:31:07 assert: optionally fall-back to assert(3) Fall back to the system assert(3) in debug builds, which may aide in debugging. "Safe" assertions can be enabled in debug builds by setting GIT_ASSERT_HARD=0. Similarly, hard assertions can be enabled in release builds by setting GIT_ASSERT_HARD to nonzero.
Edward Thomson abe2efe1 2019-12-09T12:37:34 Introduce GIT_ASSERT macros Provide macros to replace usages of `assert`. A true `assert` is punishing as a library. Instead we should do our best to not crash. GIT_ASSERT_ARG(x) will now assert that the given argument complies to some format and sets an error message and returns `-1` if it does not. GIT_ASSERT(x) is for internal usage, and available as an internal consistency check. It will set an error message and return `-1` in the event of failure.
A-Ovchinnikov-mx 4ad36338 2020-05-11T19:10:11 Update README.md Add instructions for building libgit2 in MinGW environment
Suhaib Mujahid 3453c3b1 2020-05-11T05:14:35 Update package.json
Edward Thomson b83bc6d4 2020-05-11T09:18:36 Merge pull request #5510 from phkelley/stash-to-index-crash Fix uninitialized stack memory and NULL ptr dereference in stash_to_index
Philip Kelley 56c95cf6 2020-05-10T21:43:38 Fix uninitialized stack memory and NULL ptr dereference in stash_to_index Caught by static analysis.
Segev Finer d62e44cb 2019-06-03T18:35:08 checkout: Fix removing untracked files by path in subdirectories The checkout code didn't iterate into a subdir if it didn't match the pathspec, but since the pathspec might match files in the subdir we should recurse into it (In contrast to gitignore handling). Fixes #5089
Edward Thomson 2a1d97e6 2020-05-11T00:09:18 Merge pull request #5378 from libgit2/ethomson/checkout_pathspecs Honor GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH for all checkout types
Edward Thomson 63de2128 2020-02-02T20:20:19 checkout: filter pathspecs for _all_ checkout types We were previously applying the pathspec filter for the baseline iterator during checkout, as well as the target tree. This was an oversight; in fact, we should apply the pathspec filter to _all_ checkout targets, not just trees. Add a helper function to set the iterator pathspecs from the given checkout pathspecs, and call it everywhere.
Edward Thomson 8731e1f4 2020-02-02T19:01:15 tests::checkout: only examine test10 and test11.txt The checkout::index::can_disable_pathspec_match test attempts to set a path filter of `test11.txt` and `test12.txt`, but then validates that `test10.txt` and `test11.txt` were left unmodified. Update the test's path filter to match the expectation.
Felix Lapalme 24bd12c4 2020-02-02T01:00:15 Create test case demonstrating checkout bug w/ pathspec match disabled
Edward Thomson 02d27f61 2020-05-10T23:42:43 Merge pull request #5482 from pks-t/pks/coding-style docs: add documentation for our coding style
Edward Thomson d08f72eb 2020-05-10T23:38:48 Merge pull request #5500 from phkelley/enable-control-flow-guard MSVC: Enable Control Flow Guard (CFG)
Edward Thomson 898caead 2020-05-10T19:03:10 Merge pull request #5431 from libgit2/ethomson/hexdump git__hexdump: better mimic `hexdump -C`
Philip Kelley 63f9fbee 2020-04-25T15:37:45 MSVC: Enable Control Flow Guard (CFG) This feature requires Visual Studio 2015 (MSVC_VERSION = 1900) or later. As the minimum required CMake version is currently less than 3.7, GREATER_EQUAL is not available to us and we must invert the result of the LESS operator.
Patrick Steinhardt 66137ff6 2020-04-19T12:08:24 Merge pull request #5383 from ognarb/feature/blame-ignore-whitespace Feature: Allow blame to ignore whitespace change