summaryrefslogtreecommitdiff
path: root/src/buildtool/file_system/git_repo.cpp
AgeCommit message (Collapse)Author
2025-06-05GitRepo: Fix wrong handling of fatal loggingPaul Cristian Sarbu
...in creating Git tree from filesystem directory.
2025-06-05GitRepo: Fix capitalisation inconsistency in loggingPaul Cristian Sarbu
2025-06-05GitRepo: Use std::invoke to call generic loggerPaul Cristian Sarbu
2025-06-05GitRepo: Reduce logging levelsPaul Cristian Sarbu
...in methods that should not report at error level themselves, but let this be handled by its callers. While there, remove an unneeded path manipulation in a defferent set of log messages.
2025-06-05GitRepo: Ensure compliance with existing noexcept specifiersPaul Cristian Sarbu
...while also removing some unneeded one. Do not implicitly trust that the third-party code called in these methods is non-throwing and instead properly handle any exception that might arise. Also remove the specifiers from some anonymous namespace methods where a try-catch would be overkill and let their callers handle any exceptions instead.
2025-06-04GitRepo: Fix wrong logging level in reading treesPaul Cristian Sarbu
This removes a scenario where otherwise successful (exit code 0) calls to just and just-mr would result in an error-level log message.
2025-06-04GitRepo: Add tree reader without symlink checkerPaul Cristian Sarbu
2025-06-04git_cas: Be explicit in hash type (raw or hex) when readingPaul Cristian Sarbu
2025-05-28GitRepo: Methods expected to use a logger should do so...Paul Cristian Sarbu
...in all return paths, including in reporting caught exceptions. In this way give the opportunity for any calling AsyncMap to receive an expected fatal logger call on failure and thus be able to shut down gracefully. This is in line with the AsyncMap design, where the loggers are assumed to be safe to call by a consumer.
2025-04-01git_repo: Add missing include in debug modePaul Cristian Sarbu
2025-01-15Add to GitRepo common implementation IsTreeInRepoMaksim Denisov
2025-01-15Add to GitRepo common implementation of ImportToGitMaksim Denisov
2024-12-19Fix struct member initializationOliver Reiche
2024-12-19Remove unused functionOliver Reiche
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-05GitRepo: don't reassign git_repository to git_odbMaksim Denisov
...and remove GuardedRepo.
2024-12-05GitCAS: implement method for creation of an empty GitCASMaksim Denisov
...and use it in GitRepo to set custom backends.
2024-12-05GitRepo: keep GuardedRepo unexposed and adjust the interface.Maksim Denisov
2024-12-03For FetchIntoODBBackend "Ensure" backend is validMaksim Denisov
2024-12-03Avoid double deletion of git_repository in GuardedRepoMaksim Denisov
2024-12-02Synchronize initialization of a git repo across processesMaksim Denisov
2024-11-28Ensure gitstrarray gets created with alive pointers.Maksim Denisov
2024-11-14file_system: Implement IWYU suggestionsPaul Cristian Sarbu
2024-10-08Name global constants using kCamelCase.Maksim Denisov
2024-10-08Name classes, structs and enums using CamelCase.Maksim Denisov
2024-10-07Enable readability-redundant-member-init check.Maksim Denisov
2024-10-07Enable bugprone-empty-catch check.Maksim Denisov
2024-10-07Replace manual new allocations for git_strarray with std::vectorsMaksim Denisov
...and remove unused code from git_utils
2024-09-26Fix redundant std::optional conversionsMaksim Denisov
...proposed by clang-tidy. Enable bugprone-optional-value-conversion check.
2024-09-12Remove unused variablesKlaus Aehlig
2024-09-11Use ArtifactDigestFactory in GitRepoMaksim Denisov
...to create ArtifactDigests.
2024-08-30Replace bazel_re::Digest in GitRepo::SymlinksCheckFunc callbackMaksim Denisov
...with ArtifactDigest.
2024-08-27Reformat code to comply with clang-format 18Klaus Aehlig
... while keeping our .clang-format file.
2024-08-26GitRepo: Create commit from a directory explicitly...Paul Cristian Sarbu
...by writing its tree directly in the object database instead of working with the index. This allows the creation of trees that contain also entries with 'magic' names, such as the .git folder or .gitignore files. Callers must ensure the given directory only contains the needed entries. In particular, just-mr maps and serve service are updated to separate the import-to-Git repository path from the temporary path containing the content to be committed, to avoid polluting the content path with entries generated on repository initialization.
2024-08-26GitRepo: Add method to create tree from directoryPaul Cristian Sarbu
The tree is traversed bottom-up and each entry is explicitly added to the object database: non-directory entries have their content read and are added as blobs with corresponding permissions based on file type (regular, executable, symlink), while subdirectories are added as trees via CreateTree based on the already added blobs.
2024-08-26GitRepo: Change logic that creates commits to explicitly give directoryPaul Cristian Sarbu
In preparation for subsequent changes, specify the directory path containing the tree content to be committed explicitly. This change will allow eventually to be able to specify paths that are different from the root path of the repository in which the commit is created. This commit renames and refactors StageAndCommitAllAnnonymous to allow a directory path to be passed. The just-mr and serve service logic is updated such that current behaviour is otherwise unchanged.
2024-08-26GitRepo: Create trees by directly writing to object databasePaul Cristian Sarbu
The libgit2 treebuilder has unnecessary validity checks for tree entries, including for Git-specific magic names (such as '.git'), which cannot be disabled. However, in our tool any filesystem entry should be allowed to be part of a tree. Therefore, the treebuilder-based implementation for CreateTree is replaced by a direct writing of trees, by content, into the underlying repository object database. Additionally, as direct insertion into the object dabase does not check the validity of the tree entries, as was done implicitly by the treebuilder before, add a check for existence of the tree entries into the debug-level generic validity check, with the option to not perform it for ReadTree (as it is unnecessary there).
2024-08-26GitRepo: Update to use specific getter for repository root pathPaul Cristian Sarbu
2024-08-07Pass SymlinksCheckFunc to GitRepo as not_nullMaksim Denisov
+ invoke it only if there are symlinks to check + remove the corresponding runtime check since it is replaced by a compile-time check
2024-07-19git_repo: return keep tags on successKlaus Aehlig
... instead of the plain boolean value.
2024-07-05Pass StorageConfig to git_repo and git_repo_remoteMaksim Denisov
2024-07-05Use StorageConfig functionality via Instance()Maksim Denisov
...to track changes during refactoring easier.
2024-06-28Use (un)expected for Git repoOliver Reiche
2024-04-10GitRepo: Add method to keep tree alive by taggingPaul Cristian Sarbu
Also adds an appropriate test for this method.
2024-04-10git_repo: Add blob writer methodPaul Cristian Sarbu
Also extends the tests accordingly.
2024-04-10git_repo: Improve error message for CreateTreePaul Cristian Sarbu
2024-04-08Use properly included standard library types by defaultPaul Cristian Sarbu
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>
2024-03-15Clean up more includes and targetsPaul Cristian Sarbu
Some of the more specific issues addressed: - missing log_level target/include - header-only libs wrongly marking deps as private - missing/misplaced gsl includes