Commit graph

12 commits

Author SHA1 Message Date
Yuya Nishihara
e921791574 cli: bookmark: add --remote argument to track/untrack, deprecate name@remote
These two are the last commands which don't support logical operators in string
patterns. The old <kind>:<name>@<remote> syntax had various problems including:

 1. substring patterns look weird (e.g. `substring:x@y` means `*x*@*y*`)
 2. cannot express "all but <name> for all remotes" (e.g. `(~gh-pages)@(*)`)

In addition to that, the revset parser doesn't support `<name>@<remote>`
prefixed by `<kind>:`.

This patch introduces separate --remote argument to address these problems. The
default is `glob:*` (or `~git`), so we wouldn't have to specify the remote in
many cases. One caveat is that `jj bookmark track` is not idempotent if there
are multiple remotes:

    # there are two remotes: origin and upstream,
    # and only foo@origin exists
    $ jj bookmark track foo
    # tracks foo@origin and creates new local bookmark foo
    $ jj bookmark track foo
    # tracks absent foo@upstream as we now have a local bookmark

This is wild. We might want to add a flag or a new command to track absent
remote bookmarks to push.

"Unmatched names" warnings are now emitted for bookmark and remote names
separately. To keep the implementation simple, the search space isn't restricted
by the other parameter. For example, "jj bookmark track foo --remote=bar" won't
show a warning if "foo" exists locally or in any remote.

Closes #4260
2025-12-13 01:32:49 +00:00
Björn Kautler
17145beb76 docs: improve Git command table
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
2025-11-18 00:00:45 +00:00
Martin von Zweigbergk
32aee9dbdf cli: deprecate --destination/-d in favor of --onto/-o
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
As we have discussed many times on Discord and GitHub, `--destination`
is not a great name because `--insert-before` and `--insert-after` are
also destinations. The most popular alternative seems to be
`--onto`. We already use that term in descriptions in several places,
such as in the help text for `rebase -d` where we say "The revision(s)
to rebase onto". This patch therefore renames the `--destination` flag
to `--onto`.

The short name naturally becomes `-o`. That is perhaps a little
unfortunate because it's a common short name for `--output <file>`
arguments, but we don't use that anywhere so it seems fine.

Perhaps we should also rename `--source` (used by `rebase` and `fix`)
to something else. Perhaps the most obvious name is `--descendants`,
but the short form would be `-d`, which is of course already taken by
`--destination` in the case of `rebase`. Either way, I'm leaving that
rename for later. It would be good to do it before next release if we
are going to do it, though.

Closes #7941
2025-11-08 14:56:37 +00:00
Dinu Blanovschi
ac4704278e docs: Add untrack command for Jujutsu in git command table
Some checks failed
binaries / Build binary artifacts (push) Has been cancelled
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
2025-09-30 18:16:15 +00:00
Matt T. Proud
3c20da336d docs: provide analogue for git checkout
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
This commit includes a jj recipe for the Git command table that is
approximately equivalent to Git's checkout command, which can be used to
examine source code at named revision or branch.  This is indispensible
for learn-by-doing types who are curious how to remap Git usage back
onto jj with minimal effort.
2025-09-08 20:57:26 +00:00
Remo Senekowitsch
ec5c135387 git: colocate repos by default
Closes https://github.com/jj-vcs/jj/issues/7189

Colocated repos have some advantages and some disadvantages. On the
whole, I think making Git repos colocated by default is a better
trade-off, especially for new users. With the `git.colocate` setting,
(experienced) users can easily change this according to preference.

A non-exhaustive list of pros and cons of colocated repos:

pros:
* Many code editors show the changes one is currently working on based
  on Git's "dirty worktree".
* There are a lot of tools that integrate with Git which don't work at
  all in non-colocated repositories.
* There are a lot of Git features that Jujutsu doesn't have yet. When
  users ask for them, the answer is usually: "Just colocate your repo
  and run git directly for now." It's a strength that Jujutsu can focus
  on what makes it special and not have to rush the reimplementation of
  every niche feature of Git. Examples: `git rebase` tracking file
  renames, `git bisect`, `git tag`, `git range-diff`, submodules.

cons:
* Jujutsu performs worse in colocated repositories with lots of refs,
  because of the automatic `jj git import`.
* Colocated repos make branch@git references show up in Jujutsu output,
  which is usually just aesthetically displeasing or possibly even
  confusing to inexperienced users.
* Interleaving jj and (mutating) git commands can lead to confusing
  situations. Examples:
  * Creating a commit with git instead of jj will often leave a
    duplicate "work in progress" commit in Jujutsu's log.
  * Some IDEs periodically run `git fetch` in the background. This can
    lead to conflicted branches and divergent change IDs, something many
    people struggle with.
2025-09-04 11:26:28 +00:00
Remo Senekowitsch
b605639c49 cli: add redo command
This is the natural counterpart of `jj undo`. Adding `jj redo` closes
the last gap in functionality to the "undo" features of typical GUI
applications. This is much more intuitive to new users and useful than
the previous undo semantics. (Which are preserved as `jj op revert`.)

Related feature request "jj undo ergonomics":
https://github.com/jj-vcs/jj/issues/3700
2025-08-26 13:50:38 +00:00
Remo Senekowitsch
36ee36ce78 op: undo: rename to revert
This paves the way for the semantics of `jj undo` and `jj op revert` to
evolve independently. `jj op revert` is going to stay the low-level
command to apply the inverse of any operation. The new name is
consistent with `jj revert`, which applies the inverse of a commit.

`jj undo` on the other hand is planned to become a higher-level command,
which is more similar to, say, Ctrl+Z in typical GUI applications.
Running `jj undo` repeatedly will revert progressively older operations,
allowing the user to walk backwards in time. At the same time, `jj undo`
will lose the abilitly to revert arbitrary operations, to keep its
semantics simple and intuitive.

Related feature request "jj undo ergonomics":
https://github.com/jj-vcs/jj/issues/3700
2025-08-15 21:31:15 +00:00
raylu
0921975dcf docs: Add git log -G to git command table 2025-07-02 03:38:59 +00:00
Alper Cugun
0fe7b3a428 docs: Remove deprecated backout command from git table
Change default location for revert as suggested by @emilazy
2025-05-09 15:26:53 +00:00
Vincent Ging Ho Yim
24ab60b1c2 docs: split notes on jj commands into new column in Git command table 2025-04-21 00:45:01 +00:00
Vincent Ging Ho Yim
e90727b34d docs: convert Git command table from HTML to YAML
The YAML format is much easier to maintain and allows using Markdown instead of having
to escape symbols such as < and >.
2025-04-21 00:45:01 +00:00