From 8ec8a4be5a1f141e615168a9f06e5cf04b87e03d Mon Sep 17 00:00:00 2001 From: Barun Parruck Date: Thu, 27 Aug 2026 15:02:25 +0100 Subject: [PATCH] bookmark: Add git remote origin hint Adds a hint to the `jj bookmark track` command if the remote specified was unmatched - so that the user knows how to add the remote. --- cli/src/commands/bookmark/mod.rs | 5 +++-- cli/tests/test_bookmark_command.rs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/src/commands/bookmark/mod.rs b/cli/src/commands/bookmark/mod.rs index dd99a563e31..b8243f8b85f 100644 --- a/cli/src/commands/bookmark/mod.rs +++ b/cli/src/commands/bookmark/mod.rs @@ -241,6 +241,7 @@ fn warn_unmatched_remotes(ui: &Ui, view: &View, name_expr: &StringExpression) -> writeln!( ui.warning_default(), "No matching remotes for names: {}", - names.map(|name| name.as_symbol()).join(", ") - ) + names.map(|name| name.as_symbol()).join(", "), + )?; + writeln!(ui.hint_default(), "Run `jj git remote add origin `",) } diff --git a/cli/tests/test_bookmark_command.rs b/cli/tests/test_bookmark_command.rs index 8543c3d69d3..e4a0775c5c0 100644 --- a/cli/tests/test_bookmark_command.rs +++ b/cli/tests/test_bookmark_command.rs @@ -1982,6 +1982,7 @@ fn test_bookmark_track_untrack_patterns() -> TestResult { ------- stderr ------- Warning: No matching bookmarks for names: maine Warning: No matching remotes for names: unknown + Hint: Run `jj git remote add origin ` Nothing changed. [EOF] ");