summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | unset GIT_RAND_GETENTROPY to avoid linux GLIBC issues (#3)Yuang Li2022-07-261-1/+5
| | | | | | |
| | * | | | | Merge pull request #4 from lya001/shallow-clone-localYuang Li2022-07-2940-7/+816
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | Shallow clone local
| | | * | | | | rename function assign_parents_from_graftyuangli2022-07-281-2/+2
| | | | | | | |
| | | * | | | | refactor commit parent assignment with graftyuangli2022-07-281-15/+21
| | | | | | | |
| | | * | | | | fix load_graftsyuangli2022-07-281-0/+7
| | | | | | | |
| | | * | | | | improve error handlingyuangli2022-07-285-13/+7
| | | | | | | |
| | | * | | | | eliminate build warningsyuangli2022-07-277-10/+11
| | | | | | | |
| | | * | | | | fix build errorsyuangli2022-07-265-4/+5
| | | | | | | |
| | | * | | | | Merge branch 'pr/pks-t/5254' into shallow-clone-localyuangli2022-07-2641-6/+806
| | | |\ \ \ \ \ | | |/ / / / / / | | | | _ / / / | | | | / / /
| | | * | | | disable shallow clone feature flag in test cleanupYuang Li2022-06-282-0/+2
| | | | | | |
| | | * | | | fix graft assertionYuang Li2022-06-281-1/+1
| | | | | | |
| | | * | | | correct use of feature flagYuang Li2022-06-282-20/+19
| | | | | | |
| | | * | | | enable shallow clone support in tests when necessaryYuang Li2022-06-282-0/+2
| | | | | | |
| | | * | | | disable shallow clone support by defaultYuang Li2022-06-281-1/+1
| | | | | | |
| | | * | | | correct naming of feature flagYuang Li2022-06-271-1/+1
| | | | | | |
| | | * | | | use shallow feature flag in shallow clone support source codeYuang Li2022-06-272-17/+23
| | | | | | |
| | | * | | | move feature flag tests to tests/grafts/shallow.cYuang Li2022-06-273-11/+11
| | | | | | |
| | | * | | | move declaration of feature flag to graft.h/graft.cYuang Li2022-06-273-3/+4
| | | | | | |
| | | * | | | add shallow.hYuang Li2022-06-272-1/+4
| | | | | | |
| | | * | | | add test for shallow feature flagYuang Li2022-06-271-0/+11
| | | | | | |
| | | * | | | add feature flag for shallow clone supportYuang Li2022-06-272-1/+9
| | | | | | |
| | | * | | | Merge branch 'main' into pr/pks-t/5254Yuang Li2022-06-241460-8257/+22764
| | | |\ \ \ \
| | | * | | | | repository: do not expose grafting mechanismPatrick Steinhardt2020-06-274-57/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we expose the function `git_repository_shallow_roots` to get all grafted roots of the repository. This already paints us into a corner, though, as we certainly need to experiment with some functionality of the grafting mechanism before we can happily expose some of its functionality. Most importantly, we need to get right when to refresh grafts and when not. Thus, this commit removes the public function with no public replacement. We should first try and see what usecases people come up with to e.g. expose the `git_grafts` mechanism directly in the future or do something different altogether. Instead, we provide an internal interface to get weak pointers to the grafting structs part of the repository itself.
| | | * | | | | grafts: fix memory leak if replacing pre-existing graftPatrick Steinhardt2020-06-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If replacing an already existing graft in the grafts map, then we need to free the previous `git_commit_graft` structure.
| | | * | | | | grafts: move refresh logic into grafts codePatrick Steinhardt2020-06-274-61/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The refresh logic for both "normal" and shallow grafts are currently part of the repository code and implemented twice. Unify them into the grafts code by introducing two new functions to create grafts from a file and to refresh a grafts structure.
| | | * | | | | repository: disentangle shallow and normal graftsPatrick Steinhardt2020-06-272-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When loading shallow grafts, we add each of the grafting commits to the grafts backed by ".git/info/grafts". Keeping track of both grafts separately, but partially storing them in a common grafts structure is likely to lead to inconsistencies. In fact, there already are inconsistencies if refreshing shallow grafts at a later point, as we only refresh the shallows, but not the normal grafts in that case. Disentangle both grafting stores and instead check both separately when parsing commits.
| | | * | | | | repository: reuse grafts for shallow rootsPatrick Steinhardt2020-06-276-85/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The shallow roots are in fact another user of the grafting mechanism, and in essence they do use the same file format for grafted commits. Thus, instead of hand-coding the parsing logic a second time, we can just reuse the `git_grafts` structure for shallow commits, as well.
| | | * | | | | grafts: move parsing into grafts modulePatrick Steinhardt2020-06-275-37/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Parsing of grafts files is currently contained in the repository code. To make grafts-related logic more self-contained, move it into "grafts.c" instead.
| | | * | | | | repository: convert grafts parsing to use parse contextPatrick Steinhardt2020-06-272-41/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using the newly introduced `git_buf_foreach_line`, which modifies the buffer itself, we should try to use our existing parsing infrastructure in "parse.h". Convert the grafts parsing code to make use of `git_parse_ctx`. Remove the `git_buf_foreach_line` macro, as grafts have been its sole user.
| | | * | | | | grafts: make the structure self-contained and opaquePatrick Steinhardt2020-06-277-110/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to increase maintainability in the future, we should try to make structures as self-contained and opaque to its users as possible. Thus it is probably not a good idea to just typedef `git_graftmap` to `git_oidmap`, as that will make it a lot harder in the future to extend the API in the future, if this need ever arises. Refactor the code to instead declare a real structure `git_grafts`, which is completely opaque to its callers.
| | | * | | | | tests: graft commitsEtienne Samson2020-06-2732-39/+274
| | | | | | | |
| | | * | | | | commit: apply grafts when parsingEtienne Samson2020-06-271-5/+23
| | | | | | | |
| | | * | | | | repo: graft shallow roots on openEtienne Samson2020-06-271-0/+24
| | | | | | | |
| | | * | | | | repo: load shallow rootsEtienne Samson2020-06-273-0/+93
| | | | | | | |
| | | * | | | | repo: load grafts on openEtienne Samson2020-06-274-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This wires git_repository to open the .git/info/grafts file and load its contents as git_commit_grafts objects.
| | | * | | | | repo: basic graft APIEtienne Samson2020-06-272-0/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This represents (old-style) grafted commits, a.k.a an array of overridden parents for a commit's OID.
* | | | | | | | 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
| | | | | | | |