From 68779f91f051822270f156a4185350fb3c4b5017 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 20 Feb 2026 22:41:50 +0000 Subject: improve `ngit repo` output formatting - suppress fetch summary (no updates / updates: X) - write blank line to stderr after relay errors for clear separation - show identifier below title only when it differs from name - show earliest unique commit (root_commit) in metadata - restructure infrastructure into grasp servers / additional git servers / additional relays sections - display grasp servers by domain only (strip scheme, npub, repo path) - strip wss:// prefix from relay display - show maintainer names from metadata cache; fall back to short npub - append (you) next to the current user's name wherever it appears - show [name] attribution and the maintainer model note only when there is more than one maintainer --- src/lib/client.rs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/lib') diff --git a/src/lib/client.rs b/src/lib/client.rs index 68b7e1c..32c2d37 100644 --- a/src/lib/client.rs +++ b/src/lib/client.rs @@ -2265,6 +2265,42 @@ pub async fn fetching_with_report( Ok(report) } +/// Like `fetching_with_report` but suppresses the "no updates" / "updates: X" +/// summary line. Returns `true` if any relay reported an error (so the caller +/// can print a blank line to visually separate relay-error output from +/// subsequent content). +pub async fn fetching_quietly( + git_repo_path: &Path, + #[cfg(test)] client: &crate::client::MockConnect, + #[cfg(not(test))] client: &Client, + trusted_maintainer_coordinate: &Nip19Coordinate, +) -> Result<(FetchReport, bool)> { + let verbose = is_verbose(); + if verbose { + let term = console::Term::stderr(); + term.write_line("Checking nostr relays...")?; + } + let (relay_reports, progress_reporter) = client + .fetch_all( + Some(git_repo_path), + Some(trusted_maintainer_coordinate), + &HashSet::new(), + ) + .await?; + let had_errors = relay_reports.iter().any(std::result::Result::is_err); + if !had_errors { + let _ = progress_reporter.clear(); + } + // Drop the MultiProgress now so all buffered stderr output is flushed + // before we write the separator blank line. + drop(progress_reporter); + if had_errors { + let _ = console::Term::stderr().write_line(""); + } + let report = consolidate_fetch_reports(relay_reports); + Ok((report, had_errors)) +} + pub async fn get_proposals_and_revisions_from_cache( git_repo_path: &Path, repo_coordinates: HashSet, -- cgit v1.2.3