summaryrefslogtreecommitdiff
path: root/src/buildtool/file_system/git_cas.hpp
AgeCommit message (Collapse)Author
2025-06-04git_cas read object: allow validation of individual blobsPaul Cristian Sarbu
This allows individual blobs read to be checked, e.g., for upwards symlinks, also when not part of a tree, which performs such a validation for its entries during its parsing into a GitTree.
2025-06-04git_cas: Be explicit in hash type (raw or hex) when readingPaul Cristian Sarbu
2025-01-22Git CAS access: reduce log levelKlaus Aehlig
Trying to access a git object return a recoverable failure, hence the failure to find the object in the git object database should be logged at warning level at most. Moreover, in some cases we should log that event at an even lower level, e.g., if we're just checking the presence of the object in the local git cas to avoid unnecessary network access.
2024-12-11GitCAS::Open: allow specifying the log-level for failureKlaus Aehlig
This method returns a GitCASPtr allowing the caller to handle failure gracefully. Therefore, logging should be at most at level Warning as it is up to the caller to provide the fatal error message. Moreover, it can be at lower level in cases where failure to open that git cas is not an unexpected event, e.g., when looking for a blob in local mirrors first.
2024-12-05GitCAS: remove friend GitRepoMaksim Denisov
...and access internal state via getters.
2024-12-05GitCAS: remove mutex and locksMaksim Denisov
...since there are no unique_locks any more.
2024-12-05GitCAS: retain git_repository alive.Maksim Denisov
2024-12-05GitCAS: implement method for creation of an empty GitCASMaksim Denisov
...and use it in GitRepo to set custom backends.
2024-12-05GitCAS: remove redundant methodMaksim Denisov
2024-11-14file_system: Implement IWYU suggestionsPaul Cristian Sarbu
2024-10-07Enable readability-redundant-member-init check.Maksim Denisov
2024-08-27Reformat code to comply with clang-format 18Klaus Aehlig
... while keeping our .clang-format file.
2024-03-26Add missing system includesPaul Cristian Sarbu
Main culprits: - std::size_t, std::nullptr_t, and NULL require <cstddef> - std::move and std::forward require <utility> - unordered maps and sets require respective includes - std::for_each and std::all_of require <algorithm>
2023-05-15memcheck: fix race in libgit2...Paul Cristian Sarbu
...caused by incorrectly setting and resetting the library internal state and the misuse of pthreads in libgit2. Normally, git_libgit2_init and git_libgit2_shutdown should span the life of a worker thread in order to be safely used. However, due to an incorrect implementation of libgit2's threadstate with pthreads, on unix systems there is a race condition. Until the use of pthread_key_t is corrected in libgit2, we need to apply a workaround by always ensuring that the main thread is the first thread reaching the GitContext constructor.
2023-03-30GitRepo: Guard fake repository odb wrappingPaul Cristian Sarbu
In the current libgit2 implementation, a fake repository wrapped around an existing odb is being registered as owner the same way as a normal repository object. Therefore, one has to guard both the creation and destruction of the fake repository against all other git operations that might access the internal cache during this transfer of ownership.
2023-03-22just-mr: Shell out to system Git for fetches over SSH...Paul Cristian Sarbu
...due to limited SSH support in libgit2. In order to allow the fetches to still be parallel, we execute: git fetch --no-auto-gc --no-write-fetch-head <repo> [<branch>] This only fetches the packs without updating any refs, at the slight cost of sometimes fetching some redundant information, which for our purposes is practically a non-issue. (If really needed, a 'git gc' call can be done eventually to try to compact the fetched packs, although a save in disk space is not actually guaranteed.)
2023-02-17structure cleanup: move remote operations of GitRepo to other_tools...Paul Cristian Sarbu
...in order to not include unwanted dependencies in just proper. The new class extends the GitRepo class used for just's Git tree operations and gets used in all of just-mr's async maps.
2022-12-21Git: Wrap libgit2 raw pointersPaul Cristian Sarbu
2022-12-21Git CAS: Move Git tree ops to fake repo wrapper classPaul Cristian Sarbu
2022-12-20Git CAS: Add fake repository wrapper for git odbPaul Cristian Sarbu
2022-12-20Git CAS: Add a Git context class to maintain the libgit2 statePaul Cristian Sarbu
2022-10-12Add copyright and license notice to all source and header filesKlaus Aehlig
Signed-off-by: Goetz Brasche <goetz.brasche@huawei.com>
2022-08-05GitCAS: Support reading/creating trees without filesystem IOOliver Reiche
2022-08-05GitCAS: Add create tree via libgit2's treebuilderOliver Reiche
2022-08-05GitCAS: Implement reading git tree via libgit2Oliver Reiche
2022-03-23Apply changes suggested by clang-tidy 11Oliver Reiche
2022-02-22Initial self-hosting commitKlaus Aehlig
This is the initial version of our tool that is able to build itself. In can be bootstrapped by ./bin/bootstrap.py Co-authored-by: Oliver Reiche <oliver.reiche@huawei.com> Co-authored-by: Victor Moreno <victor.moreno1@huawei.com>