From 17143ed02545efab55c175db66a9e31db4cce0f0 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 21 Mar 2023 14:02:44 +0100 Subject: just-mr: Shell out to system Git for fetches over SSH... ...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 [] 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.) --- src/other_tools/root_maps/commit_git_map.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/other_tools/root_maps/commit_git_map.cpp') diff --git a/src/other_tools/root_maps/commit_git_map.cpp b/src/other_tools/root_maps/commit_git_map.cpp index fae205ed..3500245b 100644 --- a/src/other_tools/root_maps/commit_git_map.cpp +++ b/src/other_tools/root_maps/commit_git_map.cpp @@ -36,6 +36,7 @@ void EnsureCommit(GitRepoInfo const& repo_info, std::filesystem::path const& repo_root, GitCASPtr const& git_cas, gsl::not_null const& critical_git_op_map, + std::vector const& launcher, gsl::not_null const& ts, CommitGitMap::SetterPtr const& ws_setter, CommitGitMap::LoggerPtr const& logger) { @@ -76,6 +77,7 @@ void EnsureCommit(GitRepoInfo const& repo_info, if (not git_repo->FetchViaTmpRepo(tmp_dir->GetPath(), repo_info.repo_url, repo_info.branch, + launcher, wrapped_logger)) { return; } @@ -184,12 +186,14 @@ void EnsureCommit(GitRepoInfo const& repo_info, auto CreateCommitGitMap( gsl::not_null const& critical_git_op_map, JustMR::PathsPtr const& just_mr_paths, + std::vector const& launcher, std::size_t jobs) -> CommitGitMap { - auto commit_to_git = [critical_git_op_map, just_mr_paths](auto ts, - auto setter, - auto logger, - auto /* unused */, - auto const& key) { + auto commit_to_git = [critical_git_op_map, just_mr_paths, launcher]( + auto ts, + auto setter, + auto logger, + auto /* unused */, + auto const& key) { // get root for repo (making sure that if repo is a path, it is // absolute) std::string fetch_repo = key.repo_url; @@ -213,7 +217,7 @@ auto CreateCommitGitMap( critical_git_op_map->ConsumeAfterKeysReady( ts, {std::move(op_key)}, - [key, repo_root, critical_git_op_map, ts, setter, logger]( + [key, repo_root, critical_git_op_map, launcher, ts, setter, logger]( auto const& values) { GitOpValue op_result = *values[0]; // check flag @@ -236,6 +240,7 @@ auto CreateCommitGitMap( repo_root, op_result.git_cas, critical_git_op_map, + launcher, ts, setter, wrapped_logger); -- cgit v1.2.3