From 038d74edf7a39e8b4274c6f4efdaa4dc06a432a6 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 4 Nov 2025 20:06:11 +0100 Subject: [PATCH] Git fetcher: Restore progress indication We were calling git with `--quiet` in order not to mess up Nix's progress bar. However, `runProgram()` already suspends the progress bar (since git may be interactive) so that's no longer an issue. So we can just run with `--progress` instead. --- src/libfetchers/git-utils.cc | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/libfetchers/git-utils.cc b/src/libfetchers/git-utils.cc index 2265549bb..1bd5b0b94 100644 --- a/src/libfetchers/git-utils.cc +++ b/src/libfetchers/git-utils.cc @@ -582,25 +582,15 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this // then use code that was removed in this commit (see blame) auto dir = this->path; - Strings gitArgs{"-C", dir.string(), "--git-dir", ".", "fetch", "--quiet", "--force"}; + Strings gitArgs{"-C", dir.string(), "--git-dir", ".", "fetch", "--progress", "--force"}; if (shallow) append(gitArgs, {"--depth", "1"}); append(gitArgs, {std::string("--"), url, refspec}); - auto [status, output] = runProgram( - RunOptions{ - .program = "git", - .lookupPath = true, - // FIXME: git stderr messes up our progress indicator, so - // we're using --quiet for now. Should process its stderr. - .args = gitArgs, - .input = {}, - .mergeStderrToStdout = true, - .isInteractive = true}); + auto status = runProgram(RunOptions{.program = "git", .args = gitArgs, .isInteractive = true}).first; - if (status > 0) { - throw Error("Failed to fetch git repository %s : %s", url, output); - } + if (status > 0) + throw Error("Failed to fetch git repository '%s'", url); } void verifyCommit(const Hash & rev, const std::vector & publicKeys) override