From 8a43eaaf8553222d4fa131550516683d1965e3d8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 31 Aug 2022 16:21:07 +0200 Subject: [PATCH] GitInputScheme: Add some progress indication --- src/libfetchers/git.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc index 0270ed502..f0cb157c7 100644 --- a/src/libfetchers/git.cc +++ b/src/libfetchers/git.cc @@ -460,6 +460,8 @@ struct GitInputScheme : InputScheme return *revCount; } + Activity act(*logger, lvlChatty, actUnknown, fmt("getting Git revision count of '%s'", repoInfo.url)); + auto revCount = std::stoull( runProgram("git", true, { "-C", repoDir, "--git-dir", repoInfo.gitDir, "rev-list", "--count", rev.gitRev() })); @@ -659,15 +661,17 @@ struct GitInputScheme : InputScheme { throw Error( "Cannot find Git revision '%s' in ref '%s' of repository '%s'! " - "Please make sure that the " ANSI_BOLD "rev" ANSI_NORMAL " exists on the " - ANSI_BOLD "ref" ANSI_NORMAL " you've specified or add " ANSI_BOLD - "allRefs = true;" ANSI_NORMAL " to " ANSI_BOLD "fetchGit" ANSI_NORMAL ".", + "Please make sure that the " ANSI_BOLD "rev" ANSI_NORMAL " exists on the " + ANSI_BOLD "ref" ANSI_NORMAL " you've specified or add " ANSI_BOLD + "allRefs = true;" ANSI_NORMAL " to " ANSI_BOLD "fetchGit" ANSI_NORMAL ".", input.getRev()->gitRev(), ref, repoInfo.url ); } + Activity act(*logger, lvlChatty, actUnknown, fmt("copying Git tree '%s' to the store", input.to_string())); + if (repoInfo.submodules) { Path tmpGitDir = createTempDir(); AutoDelete delTmpGitDir(tmpGitDir, true);