444 Commits

Author SHA1 Message Date
Stephen Jennings
4c615c0715 run: Add --restore-descendants option 2026-06-29 19:47:17 +00:00
Stephen Jennings
425881c360 run: Add --clean flag to wipe working copies before each job
--clean deletes each workspace's working_copy/ and state/ directories
after acquiring the lock, so every commit starts from a freshly
checked-out tree. Build artifacts from previous runs are not reused.
2026-06-24 00:26:55 +00:00
Stephen Jennings
5a9b9c3b95 run: Reuse a pool of workspaces between invocations
Previously, we created a new unique working copy for each invocation
named after the commit ID. This works but can be very slow to rebuild
the working copy and any ignored build artifacts between each
invocation.

Workspaces used for `jj run` are now named `1`, `2`, ..., `N`, where `N`
comes from either `--jobs N`, the config value `run.jobs`, or defaults
to 1.

Remove the single global lock that prevented multiple `jj run` instances
from executing concurrently. Multiple processes wait for each workspace
individually.

Workspaces persist between command invocations so build artifacts are
reused. The `tree_state` file in each is used to check out the next
revision while leaving ignored files in place.

The previous "fresh workspace" behavior will be restored in a future
commit that adds a `--clean` flag.
2026-06-24 00:26:55 +00:00
Vincent Ging Ho Yim
f6acada8a3 cli rebase: indicate --destination as alias for --onto in help
Fix up to #8362.
2026-06-22 08:36:09 +00:00
Thomas Axelsson
64d3cea645 cli: Document templates.*_list settings in help texts
Also drops the documentation example with default config list template, as
generally it's not useful to list an example TOML block with the default values.

Fixes #9428
2026-06-21 09:34:36 +00:00
Matt Stark
760330afb9 gerrit: Add jj gerrit upload -o similar to git push -o
This allows jj to support custom options provided by the git server.
For example, chromium sometimes requires `git push -o nokeycheck`
if you intentionally uploaded a private key.
2026-06-18 23:34:42 +00:00
Stephen Jennings
64736e55fc run: Reveal command in CLI documentation 2026-06-13 06:04:44 +00:00
Joseph Lou
10facb1a8a bisect run: Update documentation
The description used to be referring to the deprecated `--command` flag
(it is now a positional argument). Also updated some other wording.
2026-06-12 16:37:43 +00:00
Yuya Nishihara
4211b00f9f cli: bookmark: add proper support for track/untrack by <name>@<remote> syntax
While it's a bit odd that the glob pattern and exact remote symbol arguments are
overloaded, the symbol syntax is undeniably convenient.

`RemoteBookmarkNamePattern` and `Display for StringPattern` have been removed as
they are no longer used.

Closes #9226
Closes #9426
2026-06-12 13:27:27 +00:00
Yuya Nishihara
30d73a5dc9 cli: show: add support for --reversed flag
I have an alias to show diffs in chronological order. This alias can be migrated
from "jj log" to "jj show" if --reversed is supported.
2026-06-09 13:52:47 +00:00
Atakan Yenel
6600e00501 cli: add garbage collection for config files of deleted repos
This PR addresses issue #9362 and adds a jj config gc command 
to cleanup the config files after repos have been created 
and deleted. 

FIXES #9362
2026-06-08 15:52:27 +00:00
Joseph Lou
d3e889b0c7 util: Add jj util backend name command
You could just `cat .jj/repo/store/type` instead, but that feels like
too much of an implementation detail.

This can be used in scripting to perform different actions based on the
backend being used. For instance, an `aliases.upload` script may check
that the backend is "git" before running `jj git push`. If more upstream
backends are added in the future, such an alias could be updated to
handle those as well. (Google has its own commit backend, so Google
users may already find benefit in this command.)
2026-05-24 14:18:58 +00:00
Sergey Kasmy
99f30f1162 show: accept multiple revisions
Even though log -p can already be used to view a list of commits and their changes,
`jj show` offers a nicer default for this purpose specifically.
This change also nicely mimics `git show` and how it handles multiple commits.
2026-05-17 21:39:24 +00:00
Martin von Zweigbergk
b34cd4123b git: explain that jj git fetch/import may abandon commits
This is surprising behavior to many users. #9365
2026-05-07 12:39:49 +00:00
dzaima
f5225927be cli: Update jj op integrate help text
`--no-integrate-operation` has been implemented by #8882
2026-04-30 14:48:53 +00:00
Yuya Nishihara
38cb8a289c cli: git: add remotes.<name>.fetch-bookmarks/tags config
This helps test experimental remote tags and migrate away from implicit tag
fetching. Suppose the default fetch-tags is changed to '*', users who have tons
of uninteresting remote tags will have to override the fetch-tags pattern.

Closes #7819
2026-04-27 23:17:46 +00:00
Adrian Freund
6ee9eb254b gerrit: add more push options
Allows passing multiple `hashtag`s adds `message`, `edit` and `merged`
options.  We are still missing `base` (should that allow passing revset
descriptions or only git commit hashes? Would have to convert),
`push-justification` (documentation says it's Google internal) and
`create-cod-token` (undocumented, Google internal option. Listed in
gerrit source code).
2026-04-24 18:16:43 +00:00
Jun Mukai
a97ce9af26 cli: file-search: Support string pattern syntax for --pattern
The `--pattern` flag now supports `kind:pattern` syntax.
The `kind` part is optional, and the pattern is treated
as regex when omitted.

Related to #7940
2026-04-22 15:43:43 +00:00
Joseph Lou
17557cd0c7 split: Update description of --message flag
It was unclear (from the short help) which revision would get the given
description. Also I find it easier to think in terms of what was
selected rather than "first commit" and "second commit".
2026-04-19 20:37:35 +00:00
rayaq
fdf9f5561b cli: support line range based file fixing for 'jj fix'.
Updated the CLI to support line range based file fixing.

* We added `line_range_arg` and `run_tool_if_zero_line_ranges` to `ToolConfig` so users can configure how changed line ranges are passed to tools and explicitly specify whether a tool should run when there are zero modified lines.
* We introduced the `--all-lines` argument to allow users to fall back to the previous behavior of formatting the entire file when `line_range_arg` is specified.
* We use a new `compute_regions_to_format` function to calculate the changed line ranges dynamically before applying each individual formatter tool in the sequence.
* Because a formatter tool might add or remove lines, shifting the line numbers for subsequent tools, this determines the exact target ranges by diffing the static base file content against the intermediate output of the previous tool.
* To validate this logic, we extended the `fake-formatter` test fixture with a `--line-ranges` argument to restrict execution to specific lines. We also introduced a `--split-even-length-lines` flag to mimic realistic formatters that expand line counts, proving our dynamic range recalculation properly shifts lines in complete end-to-end tests.
2026-04-10 19:52:19 +00:00
Sebastian Barfurth
90cf756e6e cli: add global option to not commit transaction
This patch adds a global `--no-integrate-operation` flag that prevents
integration/publishing of most operations, including the ones created by
`snapshot_working_copy()` and `finish_transaction()`. The operations
are still created as usual.

We provide `jj op integrate` to manually reintegrate operations created by
commands with this flag enabled.

Closes #2562

Co-authored-by: Martin von Zweigbergk <martinvonz@google.com>
2026-04-02 18:36:15 +00:00
Gabriel Goller
fae9b2b2cf docs: document revset-based tag filtering as alternative to git tag --contains
Add documentation showing how `jj tag list -r` with revset expressions
can be used to filter tags, replacing the need for dedicated flags like
`git tag --contains` or `git tag --merged`. For example,
`jj tag list -r 'REV::'` lists tags whose targets descend from REV.

Tag operations were missing entirely from the Git command comparison
table, so this also adds entries for listing, creating, and deleting
tags alongside the filtering equivalents. The `jj tag list` help text
and the revsets doc both gain examples demonstrating these patterns.
2026-04-01 12:56:48 +00:00
Shnatu
b89f5ff2d6 cli: op: elide non-salient revisions in operation diffs
This change introduces elision of "non-salient" revisions in `jj op show`,
`jj op diff`, and `jj op log -p`. This helps keep the output focused on
meaningful changes (like mutable commits) while summarizing less relevant
changes (like large sets of immutable revisions being added or removed).

A new configuration setting `revsets.op-diff-changes-in` defines which revisions
should be shown. It defaults to `mutable() | immutable_heads()`.

A new `--show-changes-in` flag is added to these commands to allow overriding
the default elision behavior for a single invocation (e.g., `--show-changes-in=all()`).

Summary of changes:
- Added `revsets.op-diff-changes-in` config with default `mutable() | immutable_heads()`.
- Implemented filtering and elision logic in `compute_operation_commits_diff`.
- Updated `op show`, `op diff`, and `op log -p` to honor the new elision behavior.
- Added elision summaries to the output (e.g., "Elided X newly removed revisions").
- Updated documentation in `docs/config.md`.
- Added comprehensive integration tests in `cli/tests/test_operations.rs`.
2026-03-25 18:09:36 +00:00
Remo Senekowitsch
ac7a867191 cli: consistently use singular in flag names
Having a mix of flags in the singular and plural form is confusing.
In some cases, e.g. `gerrit upload --reviewer`, only a single value is
accepted per flag invocation. To supply multiple values, the flag has
to be repeated. In such cases, it makes more sense to use the singular
form. In other cases, e.g. `jj log --revision(s)`, a single flag
invocation may be provided with multiple revisions (in the form of a
revset). There, using the plural form would also make sense. But, for
consistency, the singular is used in all cases.
2026-03-18 22:26:24 +00:00
Rob Pilling
5420bb0526 docs: fix interdiff code snippet documentation
a very minor misplaced backtick
2026-03-13 21:19:50 +00:00
Ilya Grigoriev
978f9afa4a insta: update snapshot so that recent insta versions don't complain
Somebody probably used an older insta version at some point after we
last fixed it up (if it's you, no worries, no harm done!)
2026-03-11 23:49:05 +00:00
Joseph Lou
8f2884a228 arrange: Accept positional revsets (fixes #9051) 2026-03-09 13:08:58 +00:00
Martin von Zweigbergk
b429552eae cli revert: revert "revert: allow revisions as positional argument"
This reverts commit 4dc6323bfd.

There's talk about maybe making the command accept paths, so let's
revert this at least for now so it's not part of the next
release. That way we have more time to think about it.
2026-03-03 21:41:47 +00:00
Richard Smith
e67aa6280e cli: make jj git fetch documentation clearer
Document the default behavior, when `--remote` is not specified, in the
main command documentation, alongside the documentation for the case
where `--tag` and `--branch` are not specified. Don't put it in the
documentation for the `--remote` flag, since it's not documentation
about the behavior of that flag.
2026-03-03 01:28:15 +00:00
Yuya Nishihara
4b0415ed83 cli: drop support for deprecated "op undo" command and flags 2026-03-01 08:06:20 +00:00
George Christou
70f07cee7c cli: bookmark rename: add --overwrite-existing flag 2026-02-28 12:40:59 +00:00
William Phetsinorath
8872839aa7 cli: add support for push options
Signed-off-by: William Phetsinorath <william.phetsinorath@shikanime.studio>
Change-Id: I05c31fe87ba4d252f49a60c63412518f6a6a6964
2026-02-27 08:28:23 +00:00
Scott Taylor
f1c7d8402f cli: remove example from bookmark move help text
Now that this can be done with `jj bookmark advance --to @-`, I don't
think it makes sense to include this as an example anymore.
2026-02-25 01:40:17 +00:00
Martin von Zweigbergk
bfee2aeaf3 arrange: unhide command
Now that the command support reordering and abandoning commits, I
think it's already sufficient to make it useful, so let's unhide it.

Closes #1531
2026-02-24 16:46:41 +00:00
Anton Älgmyr
1d18429783 bookmarks: Add jj tug inspired advance command
A common recommendation for new users is for them to add a `jj tug`
alias. This change makes that alias unnecessary by adding a native
version.

The command has customization points `revsets.advance-default-to`
and `revset-aliases.closest_bookmarks(to)` to adapt to different workflows.

The default target is `@` for parity with other bookmark commands.

Possible useful revsets to use can be found in
https://github.com/jj-vcs/jj/discussions/5568#discussioncomment-12674748.

Co-authored-by: Scott Taylor <scott11x8@gmail.com>
2026-02-23 12:33:11 +00:00
Matt Stark
6b1cda418a gerrit: Create default revisions for jj gerrit upload 2026-02-22 23:38:02 +00:00
Matt Stark
bbe9e9d90e gerrit: Implement jj gerrit upload options.
See https://gerrit-review.googlesource.com/Documentation/user-upload.html.

Note that although some options only show how to use the %suffix in the
documentation, I have tested and they also support the `-o` flag on
push.
2026-02-19 00:11:54 +00:00
Ilya Grigoriev
3a9e56d06b tests: run cargo insta test --force-update-snapshots
Note that you might get different result if you use cargo-insta <1.63.3
2026-02-17 17:43:54 +00:00
Joseph Lou
a5783bcf86 cli: Add jj util snapshot command
This essentially does the same thing as `jj debug snapshot`, but is
actually officially documented and thus "supported". We've added it to
the `util` subcommand because that seems more intuitive for the end
user, despite other `util` commands not usually needing the repo at all.
2026-02-14 15:33:34 +00:00
Theodore Dubois
7f1b6a33e2 rebase: add --simplify-parents flag to jj rebase
Fixes: #7711
2026-02-06 23:19:49 +00:00
Martin von Zweigbergk
be437286f4 revert: make revision to revert required
It's currently not a syntax error to not pass any revision
arguments. It results in "No revisions to revert." instead. This patch
makes it an error, which means clap will help us give the user a
better error message.
2026-02-06 15:50:38 +00:00
Martin von Zweigbergk
5ae0bc2204 revert: allow revisions as positional argument
I don't see a reason not to allow revisions as positional arguments
for `jj revert`. I don't think we'll ever want to pass path arguments
to the command.

Unlike the other commands that accept revisions as positional or named
arguments, I didn't make the named one hidden here since it's already
been visible for a long time.
2026-02-06 15:50:38 +00:00
Steve Klabnik
5a62731348 docs: mention that jj fix requires determinism
Fixes the documentation part of #7881.
2026-02-04 17:14:54 +00:00
Martin von Zweigbergk
3fdd025688 status: in help text, add pointer to jj diff -s -r
It seems somewhat common that users want the `jj diff -s` output from
`jj show` for another revision, so let's add a pointer to it.
2026-02-04 00:24:11 +00:00
Yuya Nishihara
9bfc8480ff cli: git fetch: disable default when --branch or --tag is specified
This behavior is similar to "jj git push". If we add "jj git push --tag" option,
it would disable the default revset.

No changelog entry is added because "jj git fetch --tag" isn't released yet.
It's also experimental.
2026-02-03 00:23:40 +00:00
Jonas Helgemo
2f3e21ebee docs: add --author flag usage examples for the metaedit command
- Added example command showing --author flag usage to metaedit.rs

The docs show examples for other similar commands, but not for the
author command. Since the format is not obvious an example is helpful.
2026-01-26 17:16:31 +00:00
Steve Klabnik
6302b8b9ed cli: fix --git-repo being ignored when git.colocate config is true
When `git.colocate` config is true (the default), the `--git-repo` flag
for `jj git init` was silently ignored. This happened because the
colocate logic was checked before the --git-repo logic:

    let colocate = if command.settings().get_bool("git.colocate")? {
        !args.no_colocate  // true unless --no-colocate passed
    } else {
        args.colocate
    };

Then in `do_init()`:

    let init_mode = if colocate {
        // takes this branch, ignoring --git-repo!
    } else if let Some(path_str) = git_repo {
        // --git-repo handling never reached
    }

This meant `--git-repo` was simply ignored unless `--no-colocate` was also
passed.

This is a regression from when colocation became the default. Before
that change, `--git-repo` worked without any additional flags because
`colocate` defaulted to false. The fix preserves that original behavior
by checking for `--git-repo` first and setting `colocate = false` when
it's provided, allowing the --git-repo code path to be reached.
2026-01-23 20:00:30 +00:00
Paul Smith
c64d42eecd workspace add: add -m/--message flag for setting commit description
This change adds the ability to provide a description for the commit
when a workspace is added.

Example:

```
$ jj workspace add -m "wip bugfix" --name bugfix ../bugfix
Created workspace in "../bugfix"
Working copy  (@) now at: xmskztnv 564c419d (empty) wip bugfix
Parent commit (@-)      : zzzzzzzz 00000000 (empty) (no description set)
```

Currently, when a workspace is added, the new (empty) commit that is
created has no description set.

This change to `workspace add` mirrors the option to the `new` command,
which can take zero or more `-m/--message` flags for setting the
description for a new commit. The same logic for creating the new commit
for a workspace applies in terms of parent revisions, so this change
brings `new` and `workspace add` closer together in terms of CLI
affordances.

Similary to `new`, this change permits multiple message flags to be
supplied on the CLI. It also retains the behavior of not otherwise
creating a description of just trailers if no message flag were supplied
but trailers were set.
2026-01-22 23:10:55 +00:00
Pavan Kumar Sunkara
69d808fe0a workspaces: Allow retrieving the path of another workspace
This allows `jj workspace root` command to take an optional workspace
arg to print the root directory of that workspace, while defaulting to
the current workspace.

We allow this by creating a new `workspace_store` which has a separate
entry for each workspace containing its name and root directory. This
store is created during initiation of the repo and is maintained
whenever `add`, `forget` & `rename` workspace subcommands are executed.

CAUTION: Moving a workspace path will not sync the path stored in the
workspace store.

CAUTION: Specifying `jj workspace root` with a workspace created before
this will result in an error.
2026-01-21 21:04:39 +00:00
Steve Klabnik
916f9b1f6d cli: clarify difference between bookmark set and bookmark move
Update the help text to (hopefully) make the distinction clearer, and show the relationship between these two commands.

Fixes #8014
2026-01-20 23:23:52 +00:00