summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* largefile tests: only write 2GB on 32-bit platformsethomson/largefiles_32bitEdward Thomson2019-06-231-1/+5
| | | | | Don't try to feed 4 GB of data to APIs that only take a `size_t` on 32-bit platforms.
* Merge pull request #5129 from ehuss/patch-1Patrick Steinhardt2019-06-211-1/+1
|\ | | | | Fix broken link in README
| * Fix broken link in READMEEric Huss2019-06-201-1/+1
|/
* Merge pull request #5122 from libgit2/ethomson/deprecate_headlistPatrick Steinhardt2019-06-202-5/+5
|\ | | | | net: remove unused `git_headlist_cb`
| * net: remove unused `git_headlist_cb`ethomson/deprecate_headlistEdward Thomson2019-06-162-5/+5
| |
* | Merge pull request #5124 from pks-t/pks/cmake-ntlm-without-httpsEdward Thomson2019-06-171-1/+5
|\ \ | |/ |/| cmake: default NTLM client to off if no HTTPS support
| * cmake: default NTLM client to off if no HTTPS supportPatrick Steinhardt2019-06-171-1/+5
|/ | | | | | | | | If building libgit2 with `-DUSE_HTTPS=NO`, then CMake will generate an error complaining that there's no usable HTTPS backend for NTLM. In fact, it doesn't make sense to support NTLM when we don't support HTTPS. So let's should just have NTLM default to OFF when HTTPS is disabled to make life easier and to fix our OSSFuzz builds failing.
* Merge pull request #5119 from libgit2/ethomson/attrEdward Thomson2019-06-1612-91/+113
|\ | | | | attr: rename constants and macros for consistency
| * attr: rename constants and macros for consistencyethomson/attrEdward Thomson2019-06-1612-91/+113
|/ | | | | Our enumeration values are not generally suffixed with `T`. Further, our enumeration names are generally more descriptive.
* Merge pull request #5117 from libgit2/ethomson/to_fromPatrick Steinhardt2019-06-1641-106/+209
|\ | | | | Change API instances of `fromnoun` to `from_noun` (with an underscore)
| * tag: add underscore to `from` functionethomson/to_fromEdward Thomson2019-06-163-2/+15
| | | | | | | | | | | | The majority of functions are named `from_something` (with an underscore) instead of `fromsomething`. Update the tag function for consistency with the rest of the library.
| * index: rename `frombuffer` to `from_buffer`Edward Thomson2019-06-168-23/+38
| | | | | | | | | | | | The majority of functions are named `from_something` (with an underscore) instead of `fromsomething`. Update the index functions for consistency with the rest of the library.
| * blob: add underscore to `from` functionsEdward Thomson2019-06-1614-32/+89
| | | | | | | | | | | | The majority of functions are named `from_something` (with an underscore) instead of `fromsomething`. Update the blob functions for consistency with the rest of the library.
| * oid: `is_zero` instead of `iszero`Edward Thomson2019-06-1620-49/+67
| | | | | | | | | | | | The only function that is named `issomething` (without underscore) was `git_oid_iszero`. Rename it to `git_oid_is_zero` for consistency with the rest of the library.
* | Merge pull request #5118 from libgit2/ethomson/object_sizePatrick Steinhardt2019-06-163-4/+12
|\ \ | |/ |/| object: rename git_object__size to git_object_size
| * object: rename git_object__size to git_object_sizeethomson/object_sizeEdward Thomson2019-06-163-4/+12
|/ | | | We don't use double-underscores in the public API.
* Merge pull request #5110 from pks-t/pks/wildmatchEdward Thomson2019-06-1520-409/+744
|\ | | | | Replace fnmatch with wildmatch
| * fnmatch: remove unused codePatrick Steinhardt2019-06-152-296/+0
| | | | | | | | | | | | The `fnmatch` code has now been completely replaced by `wildmatch`, same as upstream git.git has been doing in 2014. Remove it.
| * attr_file: convert to use `wildmatch`Patrick Steinhardt2019-06-155-31/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upstream git has converted to use `wildmatch` instead of `fnmatch`. Convert our gitattributes logic to use `wildmatch` as the last user of `fnmatch`. Please, don't expect I know what I'm doing here: the fnmatch parser is one of the most fun things to play around with as it has a sh*tload of weird cases. In all honesty, I'm simply relying on our tests that are by now rather comprehensive in that area. The conversion actually fixes compatibility with how git.git parser "**" patterns when the given path does not contain any directory separators. Previously, a pattern "**.foo" erroneously wouldn't match a file "x.foo", while git.git would match. Remove the new-unused LEADINGDIR/NOLEADINGDIR flags for `git_attr_fnmatch`.
| * config_file: use `wildmatch` to evaluate conditionalsPatrick Steinhardt2019-06-152-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | We currently use `p_fnmatch` to compute whether a given "gitdir:" or "gitdir/i:" conditional matches the current configuration file path. As git.git has moved to use `wildmatch` instead of `p_fnmatch` throughout its complete codebase, we evaluate conditionals inconsistently with git.git in some special cases. Convert `p_fnmatch` to use `wildmatch`. The `FNM_LEADINGDIR` flag cannot be translated to `wildmatch`, but in fact git.git doesn't use it here either. And in fact, dropping it while we go increases compatibility with git.git.
| * config_file: do not include trailing '/' for "gitdir" conditionalsPatrick Steinhardt2019-06-152-28/+37
| | | | | | | | | | | | | | | | | | | | | | When evaluating "gitdir:" and "gitdir/i:" conditionals, we currently compare the given pattern with the value of `git_repository_path`. Thing is though that `git_repository_path` returns the gitdir path with trailing '/', while we actually need to match against the gitdir without it. Fix this issue by stripping the trailing '/' previous to matching. Add various tests to ensure we get this right.
| * config_file: refactor `do_match_gitdir` to improve readabilityPatrick Steinhardt2019-06-151-16/+16
| | | | | | | | | | | | | | The function `do_match_gitdir` has some horribly named parameters and variables. Rename them to improve readability. Furthermore, fix a potentially undetected out-of-memory condition when appending "**" to the pattern.
| * global: convert trivial `fnmatch` users to use `wildcard`Patrick Steinhardt2019-06-158-38/+38
| | | | | | | | | | | | | | | | | | | | Upstream git.git has converted its codebase to use wildcard in favor of fnmatch in commit 70a8fc999d (stop using fnmatch (either native or compat), 2014-02-15). To keep our own regex-matching in line with what git does, convert all trivial instances of `fnmatch` usage to use `wildcard`, instead. Trivial usage is defined to be use of `fnmatch` with either no flags or flags that have a 1:1 equivalent in wildmatch (PATHNAME, IGNORECASE).
| * posix: remove implicit include of "fnmatch.h"Patrick Steinhardt2019-06-1510-3/+11
| | | | | | | | | | | | | | | | We're about to phase out our bundled fnmatch implementation as git.git has moved to wildmatch long ago in 2014. To make it easier to spot which files are stilll using fnmatch, remove the implicit "fnmatch.h" include in "posix.h" and instead include it explicitly.
| * wildmatch: import wildmatch from git.gitPatrick Steinhardt2019-06-154-0/+619
| | | | | | | | | | | | | | | | | | | | | | In commit 70a8fc999d (stop using fnmatch (either native or compat), 2014-02-15), upstream git has switched over all code from their internal fnmatch copy to its new wildmatch code. We haven't followed suit, and thus have developed some incompatibilities in how we match regular expressions. Import git's wildmatch from v2.22.0 and add a test suite based on their t3070-wildmatch.sh tests.
* | Merge pull request #5111 from tiennou/fix/docsEdward Thomson2019-06-1511-2/+71
|\ \ | | | | | | Documentation fixes
| * | doc: add missing documentation commentsEtienne Samson2019-06-159-2/+68
| | |
| * | indexer: correct missing includesEtienne Samson2019-06-153-0/+3
| |/ | | | | | | Docurium seems to choke on this header because it can't see both git_indexer_progress & git_indexer_progress_cb, let's add the include.
* | Merge pull request #5114 from pks-t/pks/bigfile-refactoringEdward Thomson2019-06-145-157/+15
|\ \ | |/ |/| Removal of `p_fallocate`
| * posix: remove `p_fallocate` abstractionPatrick Steinhardt2019-06-144-132/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By now, we have repeatedly failed to provide a nice cross-platform implementation of `p_fallocate`. Recent tries to do that escalated quite fast to a set of different CMake checks, implementations, fallbacks, etc., which started to look real awkward to maintain. In fact, `p_fallocate` had only been introduced in commit 4e3949b73 (tests: test that largefiles can be read through the tree API, 2019-01-30) to support a test with large files, but given the maintenance costs it just seems not to be worht it. As we have removed the sole user of `p_fallocate` in the previous commit, let's drop it altogether.
| * tests: object: refactor largefile test to not use `p_fallocate`Patrick Steinhardt2019-06-141-25/+15
|/ | | | | | | | | | | | | | The `p_fallocate` platform is currently in use in our tests, only, but it proved to be quite burdensome to get it implemented in a cross-platform way. The only "real" user is the test object::tree::read::largefile, where it's used to allocate a large file in the filesystem only to commit it to the repo and read its object back again. We can simplify this quite a bit by just using an in-memory buffer of 4GB. Sure, this cannot be used on platforms with low resources. But creating 4GB files is not any better, and we already skip the test if the environment variable "GITTEST_INVASIVE_FS_SIZE" is not set. So we're arguably not worse off than before.
* Merge pull request #5055 from tiennou/cmake/backend-detectPatrick Steinhardt2019-06-147-173/+204
|\ | | | | Modularize our TLS & hash detection
| * cmake: Modulize our TLS & hash detectionEtienne Samson2019-06-147-173/+204
|/ | | | | | | | | | | | | | | The interactions between `USE_HTTPS` and `SHA1_BACKEND` have been streamlined. Previously we would have accepted not quite working configurations (like, `-DUSE_HTTPS=OFF -DSHA1_BACKEND=OpenSSL`) and, as the OpenSSL detection only ran with `USE_HTTPS`, the link would fail. The detection was moved to a new `USE_SHA1`, modeled after `USE_HTTPS`, which takes the values "CollisionDetection/Backend/Generic", to better match how the "hashing backend" is selected, the default (ON) being "CollisionDetection". Note that, as `SHA1_BACKEND` is still used internally, you might need to check what customization you're using it for.
* Merge pull request #5109 from pks-t/pks/test-mergeanalysis-variantEdward Thomson2019-06-144-202/+27
|\ | | | | tests: merge::analysis: use test variants to avoid duplicated test suites
| * tests: merge::analysis: use variants to deduplicate test suitesPatrick Steinhardt2019-06-134-202/+27
| | | | | | | | | | | | | | | | Since commit 394951ad4 (tests: allow for simple data-driven tests, 2019-06-07), we have the ability to run a given test suite with multiple variants. Use this new feature to deduplicate the test suites for merge::{trees,workdir}::analysis into a single test suite.
* | Merge pull request #5101 from libgit2/ethomson/opts_initEdward Thomson2019-06-1447-100/+297
|\ \ | | | | | | Rename options initialization functions
| * | apply: add an options struct initializerethomson/opts_initEdward Thomson2019-06-143-1/+15
| | |
| * | Rename opt init functions to `options_init`Edward Thomson2019-06-1445-99/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In libgit2 nomenclature, when we need to verb a direct object, we name a function `git_directobject_verb`. Thus, if we need to init an options structure named `git_foo_options`, then the name of the function that does that should be `git_foo_options_init`. The previous names of `git_foo_init_options` is close - it _sounds_ as if it's initializing the options of a `foo`, but in fact `git_foo_options` is its own noun that should be respected. Deprecate the old names; they'll now call directly to the new ones.
* | | Merge pull request #5112 from pks-t/pks/ntlmclient-implicit-fallthroughEdward Thomson2019-06-141-0/+2
|\ \ \ | |/ / |/| | deps: ntlmclient: disable implicit fallthrough warnings
| * | deps: ntlmclient: disable implicit fallthrough warningsPatrick Steinhardt2019-06-141-0/+2
|/ / | | | | | | | | | | | | | | | | | | The ntlmclient dependency has quite a lot of places with implicit fallthroughs. As at least modern GCC has enabled warnings on implicit fallthroughs by default, the developer is greeted with a wall of warnings when compiling that dependency. Disable implicit fallthrough warnings for ntlmclient to fix this issue.
* | Merge pull request #5097 from pks-t/pks/ignore-escapesEdward Thomson2019-06-136-1357/+222
|\ \ | | | | | | gitignore with escapes
| * | attr_file: remove invalid TODO commentPatrick Steinhardt2019-06-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In our attributes pattern parsing code, we have a comment that states we might have to convert '\' characters to '/' to have proper POSIX paths. But in fact, '\' characters are valid inside the string and act as escape mechanism for various characters, which is why we never want to convert those to POSIX directory separators. Furthermore, gitignore patterns are specified to only treat '/' as directory separators. Remove the comment to avoid future confusion.
| * | attr_file: account for escaped escapes when searching trailing spacePatrick Steinhardt2019-06-132-3/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When determining the trailing space length, we need to honor whether spaces are escaped or not. Currently, we do not check whether the escape itself is escaped, though, which might generate an off-by-one in that case as we will simply treat the space as escaped. Fix this by checking whether the backslashes preceding the space are themselves escaped.
| * | attr_file: fix unescaping of escapes required for fnmatchPatrick Steinhardt2019-06-132-2/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When parsing attribute patterns, we will eventually unescape the parsed pattern. This is required because we require custom escapes for whitespace characters, as normally they are used to terminate the current pattern. Thing is, we don't only unescape those whitespace characters, but in fact all escaped sequences. So for example if the pattern was "\*", we unescape that to "*". As this is directly passed to fnmatch(3) later, fnmatch would treat it as a simple glob matching all files where it should instead only match a file with name "*". Fix the issue by unescaping spaces, only. Add a bunch of tests to exercise escape parsing.
| * | attr_file: properly handle escaped '\' when searching non-escaped spacesPatrick Steinhardt2019-06-131-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When parsing attributes, we need to search for the first unescaped whitespace character to determine where the pattern is to be cut off. The scan fails to account for the case where the escaping '\' character is itself escaped, though, and thus we would not recognize the cut-off point in patterns like "\\ ". Refactor the scanning loop to remember whether the last character was an escape character. If it was and the next character is a '\', too, then we will reset to non-escaped mode again. Thus, we now handle escaped whitespaces as well as escaped wildcards correctly.
| * | path: only treat paths starting with '\' as absolute on Win32Patrick Steinhardt2019-06-132-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows-based systems treat paths starting with '\' as absolute, either referring to the current drive's root (e.g. "\foo" might refer to "C:\foo") or to a network path (e.g. "\\host\foo"). On the other hand, (most?) systems that are not based on Win32 accept backslashes as valid characters that may be part of the filename, and thus we cannot treat them to identify absolute paths. Change the logic to only paths starting with '\' as absolute on the Win32 platform. Add tests to avoid regressions and document behaviour.
| * | tests: unify ignore tests into their own dirPatrick Steinhardt2019-06-072-68/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had several occasions where tests for the gitignore had been added to status::ignore instead of the easier-to-handle attr::ignore test suite. This most likely resulted from the fact that the attr::ignore test suite is not easy to discover inside of the attr folder. Furthermore, ignore being part of the attributes code is an implementation detail, only, and thus shouldn't be stressed as much. Improve this by moving both attr::ignore and status::ignore tests into a new ignore test suite.
| * | tests: remove accidentally checked in backup filePatrick Steinhardt2019-06-071-1268/+0
| | | | | | | | | | | | | | | | | | | | | The "ignore.c.bak" file has accidentally been checked in via commit 191649010 (ignore: test that leading whitespace is significant, 2019-05-19) and should obviously not be part of our test suites. Delete it.
* | | Merge pull request #5108 from libgit2/ethomson/urlparse_empty_portEdward Thomson2019-06-135-8/+53
|\ \ \ | |_|/ |/| | Handle URLs with a colon after host but no port
| * | http-parser: use our bundled http-parser by defaultethomson/urlparse_empty_portEdward Thomson2019-06-133-7/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our bundled http-parser includes bugfixes, therefore we should prefer our http-parser until such time as we can identify that the system http-parser has these bugfixes (using a version check). Since these bugs are - at present - minor, retain the ability for users to force that they want to use the system http-parser anyway. This does change the cmake specification so that people _must_ opt-in to the new behavior knowingly.