summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #6555 from DimitryAndric/fix-qsort-variants-1Edward Thomson2023-05-093-11/+29
|\ | | | | util: detect all possible qsort_r and qsort_s variants
| * util: detect all possible qsort_r and qsort_s variantsDimitry Andric2023-05-083-11/+29
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported in https://bugs.freebsd.org/271234, recent versions of FreeBSD have adjusted the prototype for qsort_r() to match the POSIX interface. This causes libgit2's CMake configuration check to fail to detect qsort_r(), making it fall back to qsort_s(), which in libgit2 also has an incompatible interface. With recent versions of clang this results in a "incompatible function pointer types" compile error. Summarizing, there are four variations of 'qsort-with-context': * old style BSD qsort_r(), used in FreeBSD 13 and earlier, where the comparison function has the context parameter first * GNU or POSIX qsort_r(), also used in FreeBSD 14 and later, where the comparison function has the context parameter last * C11 qsort_s(), where the comparison function has the context parameter last * Microsoft qsort_s(), where the comparison function has the context parameter first Add explicit detections for all these variants, so they get detected as (in the same order as above): * `GIT_QSORT_R_BSD` * `GIT_QSORT_R_GNU` * `GIT_QSORT_S_C11` * `GIT_QSORT_S_MSC` An additional complication is that on FreeBSD 14 and later, <stdlib.h> uses the C11 _Generic() macro mechanism to automatically select the correct qsort_r() prototype, depending on the caller's comparison function argument. This breaks CMake's check_prototype_definition() functionality, since it tries to redefine the function, and _Generic macro is expanded inline causing a compile error. Work around that problem by putting the function names in parentheses, to prevent the preprocessor from using a macro to replace the function name. Also, in `git__qsort_r()`, change the `#if` order so the variants that do not have to use glue are preferred.
* Merge pull request #6556 from libgit2/ethomson/wrap_odbEdward Thomson2023-05-066-9/+62
|\ | | | | Support SHA256 in git_repository_wrap_odb
| * sha256: wrap_odb supports SHA256Edward Thomson2023-05-066-8/+42
| |
| * odb: test object lookups from git_repository_wrap_odbEdward Thomson2023-05-061-1/+20
|/
* Merge pull request #6554 from oreiche/oreiche/fix-oid-type-fake-repoEdward Thomson2023-05-061-0/+2
|\
| * Fix missing oid type for "fake" repositoriesOliver Reiche2023-05-031-0/+2
|/ | | | | ... otherwise git_tree__parse_raw() will fail to obtain the correct oid size, which causes the entire parse to fail.
* Merge pull request #6549 from libgit2/ethomson/sha256_experimentalEdward Thomson2023-04-22173-657/+2589
|\ | | | | sha256: less hardcoded SHA1 types and lengths
| * commit graph: support sha256Edward Thomson2023-04-105-52/+159
| |
| * midx: support sha256Edward Thomson2023-04-105-36/+96
| |
| * blame: support sha256Edward Thomson2023-04-101-16/+23
| |
| * ident: support sha256Edward Thomson2023-04-101-3/+3
| |
| * iterator: support sha256Edward Thomson2023-04-103-6/+27
| |
| * email: support sha256Edward Thomson2023-04-101-3/+4
| |
| * commit_list: support sha256Edward Thomson2023-04-101-2/+4
| |
| * describe: support sha256Edward Thomson2023-04-101-7/+10
| |
| * cherrypick: support sha256Edward Thomson2023-04-101-3/+3
| |
| * merge: support sha256Edward Thomson2023-04-103-6/+8
| |
| * repo: use `GIT_OID_DEFAULT` for default oid typeEdward Thomson2023-04-101-3/+3
| |
| * diff: parse patches with sha256Edward Thomson2023-04-1024-139/+307
| |
| * apply: support SHA256Edward Thomson2023-04-101-1/+1
| |
| * reset: support SHA256Edward Thomson2023-04-101-2/+2
| |
| * notes: support SHA256Edward Thomson2023-04-101-8/+9
| |
| * rebase: support SHA256 oidsEdward Thomson2023-04-101-84/+72
| |
| * revert: support SHA256 oidsEdward Thomson2023-04-101-11/+8
| |
| * branch: support sha256 OIDs for branch refsEdward Thomson2023-04-101-2/+2
| |
| * fetch: support SHA256 refsEdward Thomson2023-04-102-11/+13
| |
| * push: support SHA256 refsEdward Thomson2023-04-101-2/+2
| |
| * remote: support SHA256 for remote refsEdward Thomson2023-04-101-6/+14
| |
| * refdb: handle SHA256 referencesEdward Thomson2023-04-103-7/+10
| |
| * object: sha256 lookupsEdward Thomson2023-04-101-12/+22
| |
| * config: use sha256 as file checksumEdward Thomson2023-04-101-10/+8
| | | | | | | | | | | | | | | | The config file checksum is only used to detect changes internally -- it is not stored within the repository. Therefore this need not be configurable. Use SHA256 everywhere, regardless of the repository object format.
| * packbuilder: write sha256 trailers when expectedEdward Thomson2023-04-102-5/+15
| |
| * submodule: document OID as "oid" not "SHA1"Edward Thomson2023-04-101-3/+3
| |
| * oid: support sha256 in tostr_sEdward Thomson2023-04-101-1/+1
| | | | | | | | | | Our thread-local sha string buffer should be sized to support SHA256 strings.
| * odb_pack: handle sha256 short lookupsEdward Thomson2023-04-101-1/+7
| |
| * refs: honor sha256 during allocationEdward Thomson2023-04-101-1/+8
| |
| * index: add sha256 supportEdward Thomson2023-04-10106-204/+1704
| |
| * filebuf: configurable hash typeEdward Thomson2023-04-085-17/+48
| | | | | | | | | | | | `git_filebuf` hashes contents as its written; allow for SHA1 or SHA256 as that hash. Currently, most callers simply use SHA1 as they do not yet know about SHA256 themselves.
* | Merge pull request #6482 from libgit2/ethomson/xdiffEdward Thomson2023-04-1324-23/+41
|\ \ | | | | | | xdiff: move xdiff to 'deps'
| * | xdiff: move xdiff to 'deps'Edward Thomson2023-03-0324-23/+41
| | | | | | | | | | | | | | | | | | | | | xdiff is a dependency (from git core) and more properly belongs in the 'deps' directory. Move it there, and add a stub for cmake to resolve xdiff from the system location in the future. (At present, bundled xdiff remains hardcoded.)
* | | Merge pull request #6516 from libgit2/ethomson/main-is-1.7Edward Thomson2023-04-133-7/+7
|\ \ \ | | | | | | | | meta: the main branch is now v1.7.0
| * | | meta: the main branch is now v1.7.0Edward Thomson2023-04-123-7/+7
|/ / /
* | | Merge pull request #6547 from libgit2/ethomson/programdataEdward Thomson2023-04-122-2/+16
|\ \ \ | |_|/ |/| | config: return `GIT_ENOTFOUND` for missing programdata
| * | config: return `GIT_ENOTFOUND` for missing programdataEdward Thomson2023-04-112-2/+16
|/ / | | | | | | | | | | When the programdata path is missing, ensure that we pass down the `GIT_ENOTFOUND` error to the caller instead of converting it to a generic `-1`.
* | Merge pull request #6544 from libgit2/ethomson/repo_envEdward Thomson2023-04-084-286/+491
|\ \ | | | | | | repo: honor environment variables for more scenarios
| * | repo: honor GIT_CONFIG_* environment variablesEdward Thomson2023-04-042-35/+146
| | | | | | | | | | | | | | | | | | When the repository is opened with `GIT_REPOSITORY_OPEN_FROM_ENV`, honor the `GIT_CONFIG_GLOBAL`, `GIT_CONFIG_SYSTEM` and `GIT_CONFIG_NOSYSTEM` environment variables.
| * | repo: honor GIT_COMMON_DIR when respecting envEdward Thomson2023-04-042-10/+46
| | | | | | | | | | | | | | | When the repository is opened with `GIT_REPOSITORY_OPEN_FROM_ENV`, honor the `GIT_COMMON_DIR` environment variable.
| * | repo: honor GIT_WORK_TREE environment variableEdward Thomson2023-04-042-13/+62
| | | | | | | | | | | | | | | When the repository is opened with `GIT_REPOSITORY_OPEN_FROM_ENV`, honor the `GIT_WORK_TREE` environment variable.
| * | env: remove the _from_env functionEdward Thomson2023-04-042-227/+233
| | | | | | | | | | | | | | | | | | | | | Remove the `_git_repository_open_ext_from_env` and make it part of the general repository opening code path. This removes the re-entrancy, and standardizes things like index and config opening to a single place again so that we have predictable ordering of the opening procedure.