From 0710d41d9bca93c3d045242859dbe74aa12e93f7 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 9 Oct 2024 21:38:45 +0300 Subject: Print git-cat-file command line used to query symlink target on verbosity level 3 --- bpkg/fetch-git.cxx | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/bpkg/fetch-git.cxx b/bpkg/fetch-git.cxx index 5d2e5fe..c283626 100644 --- a/bpkg/fetch-git.cxx +++ b/bpkg/fetch-git.cxx @@ -119,7 +119,8 @@ namespace bpkg template static process - start_git (const common_options& co, + start_git (uint16_t verbosity, + const common_options& co, O&& out, E&& err, A&&... args) @@ -162,7 +163,8 @@ namespace bpkg // We assume that non-sanitized git environment can't harm this call. // - process pr (start_git (co, + process pr (start_git (2 /* verbosity */, + co, pipe, 2 /* stderr */, co.git_option (), "rev-parse", @@ -231,9 +233,10 @@ namespace bpkg ep = "--exec-path=" + pp.effect.directory ().string (); #endif - return process_start_callback ([] (const char* const args[], size_t n) + return process_start_callback ([verbosity] (const char* const args[], + size_t n) { - if (verb >= 2) + if (verb >= verbosity) print_process (args, n); }, 0 /* stdin */, out, err, @@ -247,6 +250,16 @@ namespace bpkg } } + template + inline static process + start_git (const common_options& co, + O&& out, + E&& err, + A&&... args) + { + return start_git (2 /* verbosity */, co, out, err, forward (args)...); + } + // Run git process, optionally suppressing progress. // template @@ -2569,7 +2582,8 @@ namespace bpkg path tp; fdpipe pipe (open_pipe ()); - process pr (start_git (co, + process pr (start_git (3 /* verbosity */, + co, pipe, 2 /* stderr */, co.git_option (), "-C", dir, -- cgit v1.1