Commit graph

10315 commits

Author SHA1 Message Date
Brian Schroeder
551e600405 index: unify Index errors into IndexError enum
This way we match how errors are organized for the other storage traits,
and we allow for networked implementations of `Index::all_heads_for_gc`
to return I/O errors.
2025-10-23 02:07:08 +00:00
Yuya Nishihara
3d43b556c3 cli: git colocation: fix check for non-main workspace
Also removed period from the error message per convention.

Fixes #7812
2025-10-23 01:50:55 +00:00
Yuya Nishihara
3a10ca3824 cli: git colocation: sort subcommands lexicographically 2025-10-23 01:50:55 +00:00
Isaac Corbrey
3c0bd635d1 code of conduct: Update @icorbrey's email for CoC enforcement
I'm moving to emails hosted under my personal domain. This reflects that
change and ensures I can still be contacted.
2025-10-22 22:52:44 +00:00
Martin von Zweigbergk
1f49e52d42 cli: check for immutable commits without evaluating full set in more cases
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 updates a somewhat arbitrary set of commands that were easy to
update.
2025-10-22 15:12:14 +00:00
Martin von Zweigbergk
62ac4d3eab abandon: check for immutable commmits without evaluating set
This should make things like accidental `jj abandon ..main` error out
much more quickly on large repos like the one at Google (without first
reading hundreds of millions of commits into memory).

I think we should update other commands in a similar way.
2025-10-22 15:12:14 +00:00
Martin von Zweigbergk
6bcab3b937 cli_util: pass unevaluted revset into find_immutable()
This will help us error out on things like `jj abandon ..main` without
first evaluating the revset to all the commits in the set.
2025-10-22 15:12:14 +00:00
Martin von Zweigbergk
6a39a81039 cli_util: treat --ignore-immutable less special in immutable_heads()
I'm about to add a version of `check_rewritable()` that works on a
revset expression instead of an evaluated revset. This patch prepares
for that by having the `--ignore-immutable` case also evaluate a
revset instead of iterating over the commits looking for the root
commit.
2025-10-22 15:12:14 +00:00
Martin von Zweigbergk
b734cd8fa0 cli: test that jj log --ignore-immutable still renders immutable commits
I had missed that `jj log` is supposed to render commits as immutable
even when `--ignore-immutable` is passed. Thanks to @yuja for pointing
this out.
2025-10-22 15:12:14 +00:00
Yuya Nishihara
34b8191c9f cli: tests: let TestEnvironment store extra env vars in OsString
We don't need to support variables in arbitrary encoding, but it's simpler to
just accept any OsString inputs.
2025-10-22 14:46:24 +00:00
Yuya Nishihara
3523e753d5 cli: tests: remove unneeded unicode conversion from TestEnvironment 2025-10-22 14:46:24 +00:00
Angel Ezquerra
3c98f9a7d3 git: add git colocation enable | disable | status commands (fixes #4624)
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 new command lets you turn a non colocated git repo into a colocated repo or vice-versa (by using the `jj git colocation enable` and `jj git colocation disable` commands respectively).
These commands simply implement the instructions found in https://github.com/jj-vcs/jj/blob/main/docs/git-compatibility.md#converting-a-repo-into-a-co-located-repo

You can also call `jj git colocation status` to show the current colocation status and `jj colocation` to show a help message (with the list of sub-commands).
2025-10-22 06:39:23 +00:00
Daniel Luz
b77bb24114 cli: restore: provide modified file completion for --changes-in/-c
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-10-21 21:22:00 +00:00
Theodore Keloglou
3d4bb85d72 github: make validation script check to not fail on non-dismissable PRs
This change prevents the PR workflow (Validate Pull Request) from
failing with:

> Error: Unhandled error: HttpError: Validation Failed: "Can not
> dismiss a dismissed pull request review"

We fix this by first checking if the PR is in a dismissable state using
latestReview.state === 'CHANGES_REQUESTED'
2025-10-21 14:34:37 +00:00
Martin von Zweigbergk
7c0328f89b docs: clarify paragraph about default colocation
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
We currently say "you can disable colocation which does X". If found
it unclear whether "X" describes what colocation does or what
disabling it does. I think can simply describe what colocation does
here. The next paragraph explains how to disable it.
2025-10-21 09:20:21 +00:00
Ilya Grigoriev
ca2b478a76 clippy: nightly clippy fixes (more Self)
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-10-21 02:00:14 +00:00
Martin von Zweigbergk
d39962416d revset: try to clarify error from exactly()
The error is currently something like "The revset was expected to have
1 elements, but more were provided". It wasn't at first clear what
"provided" was referring to. Of course it can only really refer to the
revset, but I think we say it more clearly as "The revset has more
than the expected 1 revisions". Note that I also changed "elements" to
"revisions" to clarify that the elements are revisions.
2025-10-20 22:56:32 +00:00
Martin von Zweigbergk
6fd96a75eb revset: "less [elements] were provided" -> "fewer were provided"
"Elements" is countable, so I think it should be "fewer".
2025-10-20 22:56:32 +00:00
dependabot[bot]
b313083472 cargo: bump the cargo-dependencies group across 1 directory with 12 updates
Bumps the cargo-dependencies group with 12 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.48` | `4.5.50` |
| [clap_complete](https://github.com/clap-rs/clap) | `4.5.58` | `4.5.59` |
| [clap_complete_nushell](https://github.com/clap-rs/clap) | `4.5.8` | `4.5.9` |
| [criterion](https://github.com/bheisler/criterion.rs) | `0.5.1` | `0.7.0` |
| [crossterm](https://github.com/crossterm-rs/crossterm) | `0.28.1` | `0.29.0` |
| [indexmap](https://github.com/indexmap-rs/indexmap) | `2.11.4` | `2.12.0` |
| [jsonschema](https://github.com/Stranger6667/jsonschema) | `0.32.1` | `0.33.0` |
| [proptest-state-machine](https://github.com/proptest-rs/proptest) | `0.3.1` | `0.5.0` |
| [syn](https://github.com/dtolnay/syn) | `2.0.106` | `2.0.107` |
| [timeago](https://github.com/vi/timeago) | `0.4.2` | `0.5.0` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.47.1` | `1.48.0` |
| [winreg](https://github.com/gentoo90/winreg-rs) | `0.52.0` | `0.55.0` |



Updates `clap` from 4.5.48 to 4.5.50
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.48...clap_complete-v4.5.50)

Updates `clap_complete` from 4.5.58 to 4.5.59
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.58...clap_complete-v4.5.59)

Updates `clap_complete_nushell` from 4.5.8 to 4.5.9
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete_nushell-v4.5.8...clap_complete_nushell-v4.5.9)

Updates `criterion` from 0.5.1 to 0.7.0
- [Changelog](https://github.com/bheisler/criterion.rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bheisler/criterion.rs/compare/0.5.1...0.7.0)

Updates `crossterm` from 0.28.1 to 0.29.0
- [Release notes](https://github.com/crossterm-rs/crossterm/releases)
- [Changelog](https://github.com/crossterm-rs/crossterm/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossterm-rs/crossterm/commits/0.29)

Updates `indexmap` from 2.11.4 to 2.12.0
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/main/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.11.4...2.12.0)

Updates `jsonschema` from 0.32.1 to 0.33.0
- [Release notes](https://github.com/Stranger6667/jsonschema/releases)
- [Changelog](https://github.com/Stranger6667/jsonschema/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stranger6667/jsonschema/compare/rust-v0.32.1...rust-v0.33.0)

Updates `proptest-state-machine` from 0.3.1 to 0.5.0
- [Release notes](https://github.com/proptest-rs/proptest/releases)
- [Changelog](https://github.com/proptest-rs/proptest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/proptest-rs/proptest/compare/proptest-state-machine-0.3.1...proptest-state-machine-0.5.0)

Updates `syn` from 2.0.106 to 2.0.107
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.106...2.0.107)

Updates `timeago` from 0.4.2 to 0.5.0
- [Release notes](https://github.com/vi/timeago/releases)
- [Commits](https://github.com/vi/timeago/compare/v0.4.2...v0.5.0)

Updates `tokio` from 1.47.1 to 1.48.0
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.47.1...tokio-1.48.0)

Updates `winreg` from 0.52.0 to 0.55.0
- [Release notes](https://github.com/gentoo90/winreg-rs/releases)
- [Changelog](https://github.com/gentoo90/winreg-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gentoo90/winreg-rs/compare/v0.52.0...v0.55.0)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.5.50
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: clap_complete
  dependency-version: 4.5.59
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: clap_complete_nushell
  dependency-version: 4.5.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: criterion
  dependency-version: 0.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
- dependency-name: crossterm
  dependency-version: 0.29.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
- dependency-name: indexmap
  dependency-version: 2.12.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
- dependency-name: jsonschema
  dependency-version: 0.33.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
- dependency-name: proptest-state-machine
  dependency-version: 0.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
- dependency-name: syn
  dependency-version: 2.0.107
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: timeago
  dependency-version: 0.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
- dependency-name: tokio
  dependency-version: 1.48.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
- dependency-name: winreg
  dependency-version: 0.55.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-20 21:42:58 +00:00
Austin Seipp
b151a08c3b cargo: update to prost 0.14.1
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 requires regenerating the proto files, which now derive Eq and
Hash automatically.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-10-20 19:52:18 +00:00
Martin von Zweigbergk
3a511becd6 cargo: bump ignore crate to 0.4.24
This includes the fix for
https://github.com/BurntSushi/ripgrep/issues/3127. The fix let us
optionally allow unclosed character classes in .gitignore files. It is
allowed by default when using the `GitignoreBuilder` (as we do), so we
get the fix without code changes.
2025-10-20 17:20:14 +00:00
dependabot[bot]
8a4964c463 github: bump the github-dependencies group with 4 updates
Bumps the github-dependencies group with 4 updates: [taiki-e/install-action](https://github.com/taiki-e/install-action), [cachix/install-nix-action](https://github.com/cachix/install-nix-action), [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `taiki-e/install-action` from 2.62.28 to 2.62.33
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](e7ef886cf8...e43a5023a7)

Updates `cachix/install-nix-action` from 31.8.0 to 31.8.1
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](7ab6e7fd29...fd24c48048)

Updates `astral-sh/setup-uv` from 7.1.0 to 7.1.1
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](3259c6206f...2ddd2b9cb3)

Updates `github/codeql-action` from 4.30.8 to 4.30.9
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](f443b600d9...16140ae1a1)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.62.33
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
- dependency-name: cachix/install-nix-action
  dependency-version: 31.8.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
- dependency-name: astral-sh/setup-uv
  dependency-version: 7.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
- dependency-name: github/codeql-action
  dependency-version: 4.30.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-20 15:53:49 +00:00
David Higgs
2c3b7a3240 tests: prevent cli tests from failing when generating code coverage
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-10-20 13:00:50 +00:00
Benjamin Brittain
94ad20f00e fake-formatter: remove unused clap::arg import
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-10-20 02:02:38 +00:00
Scott Taylor
cbfceb631c merged_tree: rename take() to into_merge()
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 is consistent with `MergedTreeId::into_merge`.
2025-10-19 13:14:27 +00:00
Scott Taylor
141832414a backend: remove MergedTreeId::Legacy variant
I'm planning to try to add conflict labels to `MergedTree` and
`MergedTreeId`, and it will be easier to add them if both are structs
with similar methods. Since we don't support reading/writing legacy
conflicts anymore (as far as I'm aware), I think it should be safe to
delete the `MergedTreeId::Legacy` variant now.
2025-10-19 13:14:27 +00:00
Benjamin Brittain
730d633c73 op_heads_store: convert OpHeadsStore trait to be async
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 is primarily for consistency with the other storage traits.
2025-10-19 05:58:09 +00:00
Benjamin Brittain
3881bd52d7 op_store: convert OpStore trait to be async
This is primarily for consistency with the other storage traits.
2025-10-19 05:46:00 +00:00
Owen Brooks
f88b0d8093 cli: git clone: add --branch option
When cloning with the branch option:
- Only the specified branch will be fetched
- The trunk alias is only set if the specified branch happens to be the default branch
- The clone fails if the branch does not exist in the remote
2025-10-19 05:14:11 +00:00
Owen Brooks
e98e2e58c8 cli: Add RefExpansionError for expand_fetch_refspecs 2025-10-19 05:14:11 +00:00
Martin von Zweigbergk
e6d23b60dd git_backend: correct comment about reading conflict data from extra 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
This comment currently says that we update all conflicted commits when
reading the derialized extra metadata, but that's not true for commits
with the `jj:trees` commit header.
2025-10-19 02:57:17 +00:00
Yuya Nishihara
ca4d2c2ec4 templater: do not omit parentheses from expression span
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 patch changes "primary" to non-silent rule to obtain the span including
parentheses.
2025-10-18 02:45:42 +00:00
Yuya Nishihara
e555f863a8 fileset, revset: do not omit parentheses from expression span
If parentheses were omitted, a prefix/postfix expression span reconstructed from
sub expressions would become invalid.

Fixes #7747
2025-10-18 02:45:42 +00:00
Yuya Nishihara
bd98243071 revset: extract test for function call parsing
I'll add a helper function that would be useful only for the function call
tests.
2025-10-18 02:45:42 +00:00
Yuya Nishihara
9f75ee6110 revset: use Pair type consistently when passing parsed tree around 2025-10-18 02:45:42 +00:00
ase
f4b5460a09 docs: update git compat text for colocated by default repos
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-10-17 17:15:04 +00:00
Yuya Nishihara
ba48317236 templater: add commit.local/remote_tags() methods for completeness
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-10-16 15:44:50 +00:00
Yuya Nishihara
0fb99c12cc templater: include remote tags in "tags" output
Since we can now update tags internally, local and remote tags may be out of
sync in non-colocated Git repositories. "tags" template should indicate that.
2025-10-16 15:44:50 +00:00
Yuya Nishihara
75041a2953 cli: add completion helper for existing tag names
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-10-16 03:03:38 +00:00
Yuya Nishihara
1f30c337c7 cli: add tag delete commands 2025-10-16 03:03:38 +00:00
Yuya Nishihara
4d9cfa65c1 cli: add tag set command
This is a stripped-down version of cmd_bookmark_set(). Since tags shouldn't
usually be rewritten, I've made it fail on updating existing tags by default.
2025-10-16 03:03:38 +00:00
Yuya Nishihara
97b8e916a6 cli: split tag subcommands into modules 2025-10-16 03:03:38 +00:00
Remo Senekowitsch
883d9879d2 cli complete: suggest tracking absent remote bookmarks
This is a follow-up to 937d88ff25,
which made this operation possible in the first place.
2025-10-15 20:20:07 +00:00
Gaëtan Lehmann
4be2aad955 op diff: -G as short version of --no-graph
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-10-15 17:21:29 +00:00
Gaëtan Lehmann
bb7c3c5b2d op show: -G as short version of --no-graph 2025-10-15 17:21:29 +00:00
Gaëtan Lehmann
bb072635a8 evolog: -G as short version of --no-graph 2025-10-15 17:21:29 +00:00
Gaëtan Lehmann
039863855c op log: -G as short version of --no-graph
To be consistent with `jj log -G`.
2025-10-15 17:21:29 +00:00
Martin von Zweigbergk
d4bf975b2e git-comparison: mention evil merges 2025-10-15 13:02:19 +00:00
Martin von Zweigbergk
5899d09819 git-comparison: explain that first-conflict conflicts replace rerere 2025-10-15 13:02:19 +00:00
Gaëtan Lehmann
d796ec7a9c mise: add codespell tasks
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
No file list is passed to codespell in order to let the user pass the
paths of its choice. codespell seems to do a good job at finding the
relevant files by default.
2025-10-15 09:34:08 +00:00