From 720c53a5468e069fc611fff91cb0d19e18841234 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Fri, 13 Dec 2024 12:47:07 -0600 Subject: [PATCH] new: swap order of @ and main in doc comment I followed the recommendation in the `jj new` doc to use `jj new main @` to make a merge commit and ended up with a merge commit that GitHub did not like. The PR diff included both the relevant changes from that branch plus everything I merged in. @papertigers pointed out that swapping the two args produces a merge commit GitHub understands better. Happy to add a line explaining that the order matters, but it might be too much detail for this spot. The linked doc https://martinvonz.github.io/jj/latest/working-copy/ also does not explain this. --- cli/src/commands/new.rs | 4 ++-- cli/tests/cli-reference@.md.snap | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/src/commands/new.rs b/cli/src/commands/new.rs index 09f7575b36..df676b650d 100644 --- a/cli/src/commands/new.rs +++ b/cli/src/commands/new.rs @@ -44,8 +44,8 @@ use crate::ui::Ui; /// the new commit. This can be avoided with `--no-edit`. /// /// Note that you can create a merge commit by specifying multiple revisions as -/// argument. For example, `jj new main @` will create a new commit with the -/// `main` bookmark and the working copy as parents. +/// argument. For example, `jj new @ main` will create a new commit with the +/// working copy and the `main` bookmark as parents. /// /// For more information, see /// https://martinvonz.github.io/jj/latest/working-copy/. diff --git a/cli/tests/cli-reference@.md.snap b/cli/tests/cli-reference@.md.snap index d666a72bee..8b9cc1e214 100644 --- a/cli/tests/cli-reference@.md.snap +++ b/cli/tests/cli-reference@.md.snap @@ -1392,7 +1392,7 @@ Create a new, empty change and (by default) edit it in the working copy By default, `jj` will edit the new change, making the working copy represent the new commit. This can be avoided with `--no-edit`. -Note that you can create a merge commit by specifying multiple revisions as argument. For example, `jj new main @` will create a new commit with the `main` bookmark and the working copy as parents. +Note that you can create a merge commit by specifying multiple revisions as argument. For example, `jj new @ main` will create a new commit with the working copy and the `main` bookmark as parents. For more information, see https://martinvonz.github.io/jj/latest/working-copy/.