···9191* `jj git fetch` now supports [string pattern syntax](docs/revsets.md#string-patterns)
9292 on `--remote` option and `git.fetch` configuration.
93939494+* The `jj init` stub that prints an error is now an alias that can be overridden.
9595+9496### Fixed bugs
95979698* `jj status` now shows untracked files under untracked directories.
+8
cli/src/config/misc.toml
···55b = ["bookmark"]
66ci = ["commit"]
77unamend = ["unsquash"]
88+init = [
99+ "util",
1010+ "error",
1111+ "`jj init` is not defined by default. Perhaps you meant `jj git init`?",
1212+ "--hint",
1313+ """You can configure `aliases.init=["git", "init"]` if you always use the Git backend.""",
1414+ "--"
1515+]
816917[diff.color-words]
1018max-inline-alternation = 3
+30
cli/tests/test_util_command.rs
···180180 [exit status: 1]
181181 ");
182182}
183183+184184+#[test]
185185+fn test_erroring_aliases() {
186186+ let test_env = TestEnvironment::default();
187187+ let output = test_env.run_jj_in(".", ["init", "repo"]);
188188+ insta::assert_snapshot!(output, @r#"
189189+ ------- stderr -------
190190+ Error: `jj init` is not defined by default. Perhaps you meant `jj git init`?
191191+ Hint: You can configure `aliases.init=["git", "init"]` if you always use the Git backend.
192192+ [EOF]
193193+ [exit status: 1]
194194+ "#);
195195+ let output = test_env.run_jj_in(".", ["init", "--help"]);
196196+ insta::assert_snapshot!(output, @r#"
197197+ ------- stderr -------
198198+ Error: `jj init` is not defined by default. Perhaps you meant `jj git init`?
199199+ Hint: You can configure `aliases.init=["git", "init"]` if you always use the Git backend.
200200+ [EOF]
201201+ [exit status: 1]
202202+ "#);
203203+204204+ // Test that `init` can be overridden as an alias. (We use `jj config get`
205205+ // as a command with a predictable output)
206206+ test_env.add_config(r#"aliases.init=["config", "get", "user.name"]"#);
207207+ let output = test_env.run_jj_in(".", ["init"]);
208208+ insta::assert_snapshot!(output, @r"
209209+ Test User
210210+ [EOF]
211211+ ");
212212+}