summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* v1.0.1: Update the version numbersethomson/1_0_1Edward Thomson2020-06-042-3/+3
|
* Merge pull request #5540 from libgit2/ethomson/1_0_1Edward Thomson2020-06-0413-18/+198
|\ | | | | Release v1.0.1
| * v1.0.1: prepare the changelogEdward Thomson2020-06-031-0/+30
| |
| * httpclient: clear the read_buf on new requestsEdward Thomson2020-06-031-1/+4
| | | | | | | | | | | | | | | | | | | | | | 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.
| * httpclient: don't read more than the client wantsEdward Thomson2020-06-031-0/+4
| | | | | | | | | | | | | | 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.
| * httpclient: read_body should return 0 at EOFEdward Thomson2020-06-031-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * online::clone: test a googlesource URLEdward Thomson2020-06-031-0/+8
| | | | | | | | | | Google Git (googlesource.com) behaves differently than git proper. Test that we can communicate with it.
| * tests: index::version: write v4 index: re-open repo to read written v4 indexPatrick Wang2020-06-031-1/+4
| | | | | | | | | | | | | | | | | | 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.
| * index: write v4: bugfix: prefix path with strip_len, not same_lenPatrick Wang2020-06-031-2/+2
| | | | | | | | | | 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.
| * config: test that unreadable files are treated as notfoundEdward Thomson2020-06-031-0/+17
| |
| * config: ignore unreadable configuration filesWil Shipley2020-06-031-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * feat: Check the version in package.jsonSuhaib Mujahid2020-06-031-0/+11
| |
| * Fix uninitialized stack memory and NULL ptr dereference in stash_to_indexPhilip Kelley2020-06-031-2/+2
| | | | | | | | Caught by static analysis.
| * deps: ntlmclient: use htobe64 on NetBSD toonia2020-06-031-1/+1
| |
| * Fix typo causing removal of symbol 'git_worktree_prune_init_options'Seth Junot2020-06-031-1/+1
| | | | | | | | | | | | Commit 0b5ba0d replaced this function with an "option_init" equivallent, but misspelled the replacement function. As a result, this symbol has been missing from libgit2.so ever since.
| * merge: cache negative cache results for similarity metricsPatrick Steinhardt2020-06-032-7/+97
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When computing renames, we cache the hash signatures for each of the potentially conflicting entries so that we do not need to repeatedly read the file and can at least halfway efficiently determine whether two files are similar enough to be deemed a rename. In order to make the hash signatures meaningful, we require at least four lines of data to be present, resulting in at least four different hashes that can be compared. Files that are deemed too small are not cached at all and will thus be repeatedly re-hashed, which is usually not a huge issue. The issue with above heuristic is in case a file does _not_ have at least four lines, where a line is anything separated by a consecutive run of "\n" or "\0" characters. For example "a\nb" is two lines, but "a\0\0b" is also just two lines. Taken to the extreme, a file that has megabytes of consecutive space- or NUL-only may also be deemed as too small and thus not get cached. As a result, we will repeatedly load its blob, calculate its hash signature just to finally throw it away as we notice it's not of any value. When you've got a comparitively big file that you compare against a big set of potentially renamed files, then the cost simply expodes. The issue can be trivially fixed by introducing negative cache entries. Whenever we determine that a given blob does not have a meaningful representation via a hash signature, we store this negative cache marker and will from then on not hash it again, but also ignore it as a potential rename target. This should help the "normal" case already where you have a lot of small files as rename candidates, but in the above scenario it's savings are extraordinarily high. To verify we do not hit the issue anymore with described solution, this commit adds a test that uses the exact same setup described above with one 50 megabyte blob of '\0' characters and 1000 other files that get renamed. Without the negative cache: $ time ./libgit2_clar -smerge::trees::renames::cache_recomputation >/dev/null real 11m48.377s user 11m11.576s sys 0m35.187s And with the negative cache: $ time ./libgit2_clar -smerge::trees::renames::cache_recomputation >/dev/null real 0m1.972s user 0m1.851s sys 0m0.118s So this represents a ~350-fold performance improvement, but it obviously depends on how many files you have and how big the blob is. The test number were chosen in a way that one will immediately notice as soon as the bug resurfaces.
* Merge pull request #5471 from pks-t/pks/v1.0v1.0.0Patrick Steinhardt2020-04-012-4/+55
|\ | | | | Release v1.0
| * version.h: bump version to v1.0.0Patrick Steinhardt2020-03-281-4/+4
| |
| * docs: update changelog for v1.0Patrick Steinhardt2020-03-281-0/+51
|/
* Merge pull request #5464 from pks-t/pks/refdb-backend-docsPatrick Steinhardt2020-03-261-2/+109
|\ | | | | refdb_backend: improve callback documentation
| * refdb_backend: improve callback documentationPatrick Steinhardt2020-03-261-2/+109
| | | | | | | | | | | | | | The callbacks are currently sparsely documented, making it really hard to implement a new backend without taking a look at the existing refdb_fs backend. Add documentation to make this task hopefully easier to achieve.
* | Merge pull request #5465 from libgit2/ethomson/cred_deprecationPatrick Steinhardt2020-03-261-0/+7
|\ \ | | | | | | credentials: provide backcompat for opaque structs
| * | credentials: provide backcompat for opaque structsethomson/cred_deprecationEdward Thomson2020-03-261-0/+7
|/ / | | | | | | | | | | The credential structures are now opaque and defined in `sys/credential.h`. However, we should continue to provide them for backward compatibility, unless `GIT_DEPRECATED_HARD` is set.
* | Merge pull request #5445 from lhchavez/fix-5443Edward Thomson2020-03-266-2/+32
|\ \ | | | | | | Fix segfault when calling git_blame_buffer()
| * | Fix segfault when calling git_blame_buffer()lhchavez2020-03-236-2/+32
| |/ | | | | | | | | | | | | | | This change makes sure that the hunk is not null before trying to dereference it. This avoids segfaults, especially when blaming against a modified buffer (i.e. the index). Fixes: #5443
* | Merge pull request #5463 from utkarsh2102/spell-fixPatrick Steinhardt2020-03-261-1/+1
|\ \ | |/ |/| Fix spelling error
| * Fix spelling errorUtkarsh Gupta2020-03-261-1/+1
|/ | | | Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
* Merge pull request #5456 from pks-t/pks/refdb-fs-backend-versionEdward Thomson2020-03-231-0/+3
|\ | | | | refdb_fs: initialize backend version
| * refdb_fs: initialize backend versionPatrick Steinhardt2020-03-221-0/+3
| | | | | | | | | | | | While the `git_refdb_backend()` struct has a version, we do not initialize it correctly when calling `git_refdb_backend_fs()`. Fix this by adding the call to `git_refdb_init_backend()`.
* | Merge pull request #5444 from josharian/issue5428Edward Thomson2020-03-231-4/+5
|\ \ | |/ |/| repository: improve commondir docs
| * repository: improve commondir docsJosh Bleecher Snyder2020-03-071-4/+5
| | | | | | | | Fixes #5428
* | Merge pull request #5455 from pks-t/pks/cmake-install-dirsEdward Thomson2020-03-214-19/+12
|\ \ | | | | | | cmake: use install directories provided via GNUInstallDirs
| * | cmake: use install directories provided via GNUInstallDirsPatrick Steinhardt2020-03-144-19/+12
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently hand-code logic to configure where to install our artifacts via the `LIB_INSTALL_DIR`, `INCLUDE_INSTALL_DIR` and `BIN_INSTALL_DIR` variables. This is reinventing the wheel, as CMake already provide a way to do that via `CMAKE_INSTALL_<DIR>` paths, e.g. `CMAKE_INSTALL_LIB`. This requires users of libgit2 to know about the discrepancy and will require special hacks for any build systems that handle these variables in an automated way. One such example is Gentoo Linux, which sets up these paths in both the cmake and cmake-utils eclass. So let's stop doing that: the GNUInstallDirs module handles it in a better way for us, especially so as the actual values are dependent on CMAKE_INSTALL_PREFIX. This commit removes our own set of variables and instead refers users to use the standard ones. As a second benefit, this commit also fixes our pkgconfig generation to use the GNUInstallDirs module. We had a bug there where we ignored the CMAKE_INSTALL_PREFIX when configuring the libdir and includedir keys, so if libdir was set to "lib64", then libdir would be an invalid path. With GNUInstallDirs, we can now use `CMAKE_INSTALL_FULL_LIBDIR`, which handles the prefix for us.
* | Merge pull request #5451 from pks-t/pks/docker-curlEdward Thomson2020-03-1810-51/+58
|\ \ | | | | | | azure: fix errors due to curl and removal of old VM images
| * | ci: don't use --insecureEdward Thomson2020-03-172-2/+2
| | | | | | | | | | | | mbedTLS has fixed their certificate. 🎉
| * | azure: docker: use insecure flag to fix curl downloadsPatrick Steinhardt2020-03-132-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | We currently hve some problems with our curl downloads when building Docker images. It's not quite obvious what the problem is and they seem to occur semi-randomly. To unblock our CI, let's add the "--insecure" flag to curl to ignore any certificate errors. This is intended as a temporary solution only.
| * | azure: upgrade to newer hosted VM imagesPatrick Steinhardt2020-03-133-34/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Azure is phasing out old images on March 23rd 2020, but we're currently still using them. So let's upgrade images as following: - Ubuntu 16.04 -> ubuntu-18.04 - macOS 10.13 -> macOS-10.15 - Hosted Windows machines -> vs2017-win2016 Each of them is currently the latest version. As the new Microsoft Windows machine has upgraded to MSVS2017, we need to also adjust our CMake generators to "Visual Studio 15 2017". As this CMake generator doesn't accept the target platform name anymore, we instead need to set it up via either "-A Win32" or "-A x64". [1]: https://devblogs.microsoft.com/devops/removing-older-images-in-azure-pipelines-hosted-pools/
| * | azure: docurium: fix build failure due to bumped CMake requirementsPatrick Steinhardt2020-03-131-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our Docurium builds currently depend on Debian Jessie, which has CMake v3.0 available. As rugged has bumped its CMake requirements to need at least v3.5 now, the documentation build is thus failing. Fix this by converting our Docurium Docker image to be based on Ubuntu Bionic. We already do base all of our images on Ubuntu, so I don't see any sense in using Debian here. If this was only to speed up builds, we should just go all the way and use some minimal container like Alpine anyway. Also remove cache busters. As we're rebuilding the image every time, it's we really don't need them at all.
| * | azure: docker: consistently silence curl but show errorsPatrick Steinhardt2020-03-134-12/+12
| | | | | | | | | | | | | | | | | | We currently pass the "--silent" flag to most invocations of curl, but in fact this does not only suppress the progress meter, but also any errors. So let's also pass "--show-error", too.
| * | ntlmclient: silence deprecation warnings for CommonCrypto backendPatrick Steinhardt2020-03-131-0/+2
| | | | | | | | | | | | | | | The `CC_MD4()` function has been deprecated in macOS 10.15. Silence this warning for now until we implement a proper fix.
| * | cmake: ignore deprecation notes for Secure TransportPatrick Steinhardt2020-03-131-0/+4
|/ / | | | | | | | | | | | | The Secure Transport interface we're currently using has been deprecated with macOS 10.15. As we're currently in code freeze, we cannot migrate to newer interfaces. As such, let's disable deprecation warnings for our "schannel.c" stream.
* | Merge pull request #5435 from libgit2/ethomson/canonicalEdward Thomson2020-03-105-14/+105
|\ \ | |/ |/| win32: don't canonicalize relative paths
| * win32: test relative symlinksethomson/canonicalPatrick Steinhardt2020-03-101-0/+20
| | | | | | | | Ensure that we don't canonicalize symlink targets.
| * win32: don't canonicalize symlink targetsEdward Thomson2020-03-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | Don't canonicalize symlink targets; our win32 path canonicalization routines expect an absolute path. In particular, using the path canonicalization routines for symlink targets (introduced in commit 7d55bee6d, "win32: fix relative symlinks pointing into dirs", 2020-01-10). Now, use the utf8 -> utf16 relative path handling functions, so that paths like "../foo" will be translated to "..\foo".
| * win32: introduce relative path handling functionEdward Thomson2020-03-103-2/+81
| | | | | | | | | | | | | | Add a function that takes a (possibly) relative UTF-8 path and emits a UTF-16 path with forward slashes translated to backslashes. If the given path is, in fact, absolute, it will be translated to absolute path handling rules.
| * win32: clarify usage of path canonicalization funcsEdward Thomson2020-03-082-10/+3
|/ | | | | | | | | | | The path canonicalization functions on win32 are intended to canonicalize absolute paths; those with prefixes. In other words, things start with drive letters (`C:\`), share names (`\\server\share`), or other prefixes (`\\?\`). This function removes leading `..` that occur after the prefix but before the directory/file portion (eg, turning `C:\..\..\..\foo` into `C:\foo`). This translation is not appropriate for local paths.
* Merge pull request #5422 from pks-t/pks/cmake-booleansEdward Thomson2020-03-065-1/+30
|\ | | | | CMake booleans
| * cmake: fix ENABLE_TRACE parameter being too strictPatrick Steinhardt2020-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | In order to check whether tracing support should be turned on, we check whether ENABLE_TRACE equals "ON". This is being much too strict, as CMake will also treat "on", "true", "yes" and others as true-ish, but passing them will disable tracing support now. Fix the issue by simply removing the STREQUAL, which will cause CMake to do the right thing automatically.
| * cmake: sanitize boolean options passed by userPatrick Steinhardt2020-02-244-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting with our conversions to mix backend-autodetection and selection into a single variable (USE_GSSAPI, USE_HTTPS, USE_SHA1), we have introduced a simple STREQUAL to check for "ON", which indicates that the user wants us to auto-detect available backends and pick any one that's available. This behaviour deviates from previous behaviour, as passing a value like "yes", "on" or "true" will in fact be treated like a backend name and result in autodetection failure. Fix the issue by introducing a new function `SanitizeBool`. Given a variable that may hold a boolean value, the function will sanitize that variable to hold either "ON" or "OFF". In case it is not a recognized boolean, we will just keep the value as-is. This fixes the above described issue.
* | Merge pull request #5439 from ignatenkobrain/patch-2Edward Thomson2020-03-061-1/+1
|\ \ | | | | | | Set proper pkg-config dependency for pcre2