diff --git a/src/commands.rs b/src/commands.rs index 7df9ff0a7..d61c7818b 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1100,9 +1100,10 @@ Set `ui.allow-init-native` to allow initializing a repo with the native backend. let relative_wc_path = file_util::relative_path(&cwd, &wc_path); writeln!(ui, "Initialized repo in \"{}\"", relative_wc_path.display())?; if args.git && wc_path.join(".git").exists() { - ui.write_warn(format!( - "Empty repo created. To create repo backed by existing Git repo, run `jj init \ - --git-repo={}` instead.\n", + ui.write_warn("Empty repo created.\n")?; + ui.write_hint(format!( + "Hint: To create a repo backed by the existing Git repo, run `jj init --git-repo={}` \ + instead.\n", relative_wc_path.display() ))?; } diff --git a/tests/test_init_command.rs b/tests/test_init_command.rs index 50416531c..f5c187899 100644 --- a/tests/test_init_command.rs +++ b/tests/test_init_command.rs @@ -169,7 +169,8 @@ fn test_init_git_internal_but_could_be_colocated() { Initialized repo in "." "###); insta::assert_snapshot!(get_stderr_string(&assert), @r###" - Empty repo created. To create repo backed by existing Git repo, run `jj init --git-repo=.` instead. + Empty repo created. + Hint: To create a repo backed by the existing Git repo, run `jj init --git-repo=.` instead. "###); }