From 1b4e2105241d525f7766fae432adc5a7bf851a26 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Fri, 20 Dec 2024 19:21:10 +0900 Subject: [PATCH] help: move "git push --remote" explanation to main paragraph, some clarification We might add --all-remotes at some point, but "jj git push" doesn't support bulk push right now. https://github.com/jj-vcs/jj/discussions/4901#discussioncomment-11607150 --- cli/src/commands/git/push.rs | 6 ++++-- cli/tests/cli-reference@.md.snap | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cli/src/commands/git/push.rs b/cli/src/commands/git/push.rs index 0bfea4a502..e206184930 100644 --- a/cli/src/commands/git/push.rs +++ b/cli/src/commands/git/push.rs @@ -62,6 +62,10 @@ use crate::ui::Ui; /// bookmarks. Use `--all` to push all bookmarks. Use `--change` to generate /// bookmark names based on the change IDs of specific commits. /// +/// Unlike in Git, the remote to push to is not derived from the tracked remote +/// bookmarks. Use `--remote` to select the remote Git repository by name. There +/// is no option to push to multiple remotes. +/// /// Before the command actually moves, creates, or deletes a remote bookmark, it /// makes several [safety checks]. If there is a problem, you may need to run /// `jj git fetch --remote ` and/or resolve some [bookmark @@ -81,8 +85,6 @@ pub struct GitPushArgs { /// /// This defaults to the `git.push` setting. If that is not configured, and /// if there are multiple remotes, the remote named "origin" will be used. - /// Unlike in Git, the default remote is not derived from the tracked remote - /// bookmarks. #[arg(long, add = ArgValueCandidates::new(complete::git_remotes))] remote: Option, /// Push only this bookmark, or bookmarks matching a pattern (can be diff --git a/cli/tests/cli-reference@.md.snap b/cli/tests/cli-reference@.md.snap index a5858dda8e..960fdb395f 100644 --- a/cli/tests/cli-reference@.md.snap +++ b/cli/tests/cli-reference@.md.snap @@ -1154,6 +1154,8 @@ Push to a Git remote By default, pushes tracking bookmarks pointing to `remote_bookmarks(remote=)..@`. Use `--bookmark` to push specific bookmarks. Use `--all` to push all bookmarks. Use `--change` to generate bookmark names based on the change IDs of specific commits. +Unlike in Git, the remote to push to is not derived from the tracked remote bookmarks. Use `--remote` to select the remote Git repository by name. There is no option to push to multiple remotes. + Before the command actually moves, creates, or deletes a remote bookmark, it makes several [safety checks]. If there is a problem, you may need to run `jj git fetch --remote ` and/or resolve some [bookmark conflicts]. [safety checks]: https://jj-vcs.github.io/jj/latest/bookmarks/#pushing-bookmarks-safety-checks @@ -1166,7 +1168,7 @@ Before the command actually moves, creates, or deletes a remote bookmark, it mak * `--remote ` — The remote to push to (only named remotes are supported) - This defaults to the `git.push` setting. If that is not configured, and if there are multiple remotes, the remote named "origin" will be used. Unlike in Git, the default remote is not derived from the tracked remote bookmarks. + This defaults to the `git.push` setting. If that is not configured, and if there are multiple remotes, the remote named "origin" will be used. * `-b`, `--bookmark ` — Push only this bookmark, or bookmarks matching a pattern (can be repeated) By default, the specified name matches exactly. Use `glob:` prefix to select bookmarks by wildcard pattern. For details, see https://jj-vcs.github.io/jj/latest/revsets#string-patterns.