Commit graph

10315 commits

Author SHA1 Message Date
Chase Naples
adde57efc4 docs: document snapshot.auto-update-stale configuration
Add documentation for the snapshot.auto-update-stale configuration
option that was added in commit 49890fa2d but not included in the
configuration documentation.

This option allows automatic updating of stale working copies, which
is particularly useful for users with multiple workspaces.

Fixes #8033
2025-11-18 01:38:14 +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
Yuya Nishihara
6997644e99 cli: use fallible_any() to filter bookmarks by revision 2025-11-17 17:18:36 +00:00
dependabot[bot]
f3ed564c64 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.49 to 2.62.52
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](44c6d64aa6...537c30d2b4)

Updates `cachix/install-nix-action` from 31.8.3 to 31.8.4
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](7ec16f2c06...0b0e072294)

Updates `astral-sh/setup-uv` from 7.1.2 to 7.1.3
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](85856786d1...5a7eac68fb)

Updates `github/codeql-action` from 4.31.2 to 4.31.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](0499de31b9...014f16e7ab)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.62.52
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
- dependency-name: cachix/install-nix-action
  dependency-version: 31.8.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
- dependency-name: astral-sh/setup-uv
  dependency-version: 7.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
- dependency-name: github/codeql-action
  dependency-version: 4.31.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-17 17:17:55 +00:00
dependabot[bot]
a3221a7868 cargo: bump jsonschema in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [jsonschema](https://github.com/Stranger6667/jsonschema).


Updates `jsonschema` from 0.33.0 to 0.35.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.33.0...rust-v0.35.0)

---
updated-dependencies:
- dependency-name: jsonschema
  dependency-version: 0.35.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-17 17:17:33 +00:00
Yuya Nishihara
39cd3e00d1 ssh_signing: don't require ownership unnecessarily when parsing output
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-17 14:17:32 +00:00
Ilya Grigoriev
24e8aafa1b contributing: suggest setting up a RAM disk on Mac to speed up tests
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
After 42f645ed28
the tests have slowed down significantly on macOS. Apparently, `fsyncdata`
is quite slow there. However, setting up a RAM disk works around this
and makes tests fast again.

Thanks to @yuja for suggesting the RAM disk solution.

Thanks to @davidbarsky for the APFS lock article link
2025-11-16 16:06:28 +00:00
Yuya Nishihara
8091682c0b revset: allow unquoted * in identifier (or pattern expression)
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
I'm going to fix parsing of CLI string patterns to use revset parser, and it
would be annoying if inner quotes were required in addition to shell quotes:

  $ jj bookmark list 'glob:"push-*"'

There's also a plan to enable glob matching globally. This will mean that we'll
have to use either `subject(*foo*)` or `subject(substring:foo)` for substring
search.

https://github.com/jj-vcs/jj/issues/6971#issuecomment-3067038313
2025-11-15 04:11:57 +00:00
Martin von Zweigbergk
5a7a734395 cli: add visible() and hidden() aliases
When looking for a revset for visible commits, it seems natural to
reach for `visible()`. It's less obvious to find
`visible_heads()`.

Similarly, we don't have a revset for `hidden()` commits, so I added
that too. I defined it as the obvious `~visible()`. That doesn't
include all hidden commits reachable from the operation log (or from
the index). Maybe we'll want a revset for that eventually. Hopefully
we can come up with a decent name for it then. It's probably better to
define that as all of the historical commits including the current
ones in that case, so `hidden()` would not be a good name.
2025-11-15 03:37:58 +00:00
Remo Senekowitsch
876cba8e2e mise: rename "live" tasks to "watch"
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
"watch" is the more common term to refer to tasks that run whenever a
relevant file changes. A prominent example is watchexec, a tool built
for this purpose.
2025-11-14 19:45:27 +00:00
Jonas Greitemann
da3217015b docs: add a disclaimer to the community tools page 2025-11-14 17:59:14 +00:00
Martin von Zweigbergk
4bc3fbe7b9 docs: remove description of deprecated all: revset prefix
Since the prefix is no longer needed, I don't think there is much
reason to document. It just seems confusing to describe it if it's not
needed.
2025-11-14 17:56:43 +00:00
Martin von Zweigbergk
1c2d2c5f3c cli: warn when jj file list fileset doesn't match
Looks like we missed this one.
2025-11-14 14:51:27 +00:00
Martin von Zweigbergk
72500be2fc cli: add test of jj file list 2025-11-14 14:51:27 +00:00
Martin von Zweigbergk
369d45536c cli: warn when jj file untrack fileset doesn't match
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-14 13:51:01 +00:00
Jonas Greitemann
fafb24264a docs: simplify instructions to source standard PowerShell completions
Not quite sure why the previous version used a subshell expression when
the output could just as easily be piped to `Invoke-Expression`.
This is more akin to how `source` works in Fish as opposed to the Bash
builtin.

This also splits the instructions for dynamic completions into separate
lines. I think that helps better understand what's going on (PowerShell
lacks temporary environment variables) and avoid scrolling.
2025-11-14 06:57:51 +00:00
Jonas Greitemann
85c84b1445 docs: add note about PowerShell $PROFILE execution policy
On Windows, PowerShell scripts are not allowed to be executed by default
due to the default execution policy `Restricted`. This includes the
`$PROFILE` script (even though PowerShell will still happily attempt to
source it if it exist, resulting in "running scripts is disabled on this
system" errors every time it starts... go figure...).

To avoid this, you generally need to set the execution policy to at
least `RemoteSigned` (which will only block scripts downloaded from the
internet which are not signed; this is the default on Windows Server).
This can be done by running

    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

as an administrator, though there tends to be [discussions][1] about the
security tradeoffs of scope and granularity, so I think it is best to
link to the MS documentation on execution policies to allow users to
draw their own conclusions. 

This issue does not affect PowerShell users on Linux or macOS.

[1]: https://superuser.com/questions/106360/how-to-enable-execution-of-powershell-scripts
2025-11-14 06:57:51 +00:00
Lucio Franco
d9f2772988 cli: add jj file track --include-ignored flag
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 adds support for tracking ignored and oversized files with `jj file track`.

Previously, `jj file track` would silently fail to track files that were ignored by
`.gitignore` or larger than `snapshot.max-new-file-size`. This commit introduces an
`--include-ignored` flag that allows users to explicitly track these files.

## Implementation

Added a `force_tracking_matcher` field to `SnapshotOptions` that overrides ignore rules
and size limits. When `--include-ignored` is specified, the file pattern matcher is
passed as `force_tracking_matcher`, allowing three checks in `FileSnapshotter` to bypass
their usual restrictions for directory ignores, file ignores, and file size limits.

## Tests

- `test_track_ignored_with_flag`: Verifies `.gitignore`d files can be tracked
- `test_track_large_file_with_flag`: Verifies oversized files can be tracked
- `test_track_ignored_directory`: Verifies ignored directories can be tracked recursively

# Checklist

If applicable:

- [ ] I have updated `CHANGELOG.md`
- [x] I have updated the documentation (`README.md`, `docs/`, `demos/`)
- [ ] I have updated the config schema (`cli/src/config-schema.json`)
- [x] I have added/updated tests to cover my changes
2025-11-14 03:14:37 +00:00
abgox
393ded77b5 docs: add Dynamic completions for PowerShell
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-13 20:53:47 +00:00
Peter Schilling
de5d17918b template: add a format_path(...) template to allow path customization
allows end users to customize file paths, e.g. to add hyperlinks.
only used by `jj file list` for now.

references:

- https://github.com/jj-vcs/jj/issues/8021
- https://github.com/jj-vcs/jj/discussions/7920
2025-11-13 17:44:49 +00:00
Julia DeMille
054d9a40c4 rust: update MSRV to Rust 1.89
Change-Id: Ife208d70a7ed2c01136ba36afa80040a6a6a6964
2025-11-13 15:50:30 +00:00
Evan Mesterhazy
07cc559929 cli: upgrade scm-record from v0.8.0 to v0.9.0
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-13 14:19:42 +00:00
Joseph Lou
9014f64f69 template: Fail on unexpected keyword arguments
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
Any keyword arguments given to the `coalesce()` and `concat()` functions
were being silently ignored because `FunctionCallNode.args` was being
accessed directly without checking `keyword_args` at all.
2025-11-13 05:15:40 +00:00
Martin von Zweigbergk
4c328e1823 cleanup_guard: fix a Clippy warning
This was created automatically by the latest nightly Clippy version.
2025-11-13 04:57:23 +00:00
Bryce Berger
bcf85c4058 nix: flake update 2025-11-13 04:02:12 +00:00
Kyle Lippincott
4967bd780b cli: ignore $PAGER in environment by default
When `$PAGER` is set in the environment, jj uses that instead of the
default (`:builtin` on Windows, `less -FRX` everywhere else). Commonly,
users will have `PAGER=less` in their environment for various reasons,
and this is respected by jj. This means that every jj command, even one
that only outputs one or two lines, will still invoke a full screen
pager. It also means that every jj command which uses escape sequences
for color, which is most of them, will be output through a pager that
doesn't handle that well, so users see output that looks like this,
which isn't very readable:

```
ESC[1mESC[38;5;2m@ESC[0m  ESC[1mESC[38;5;13mspmESC[38;5;8mwzlkq...
```

To fix this issue that new users stumble upon, ignore `$PAGER` from the
environment, and always use our per-platform default. Users can set
`ui.pager` to select whichever pager they prefer.

This seems like the least bad option for resolving #3502. The cases I
considered were:

1. User doesn't have `PAGER` set. No change.
2. User has `PAGER=less` in their environment. We'll still run `less`,
just with `-FRX`, so this seems fine. This case is surprisingly common.
3. User has `PAGER` set because they prefer another pager. We'll ignore
that preference and run `less -FRX`.
4. User has `PAGER` set because `less` isn't available on their
platform. This is uncommon except for Windows, where we'll run
`:builtin` instead of `less -FRX` by default anyway.

This may cause some users who have intentionally set and configured
`PAGER` to be frustrated that we aren't respecting that value, but it's
generally not possible to respect that value in all cases _and_ have a
consistent and usable experience out of the box for the majority of
users.

#### Alternatives considered

1. Disable color and OSC8 hyperlinks if `PAGER` is set, since we can't
be sure the pager supports the color codes.
2. Don't paginate by default if `PAGER` is set. This seems
counterintuitive, but would at least resolve the problem. Users would
assume that the `jj` CLI doesn't support paginating, and either wrap it
in a pager themselves (this is a bad outcome) or find `ui.pager` and
change the setting.
3. Set `LESS` (iff it's not set already), then invoke `PAGER`. This
means that users setting things like `LESS=i` breaks our output as well,
and cases where `PAGER` isn't 'less' aren't fixed.

Fixes #3502
2025-11-12 23:22:33 +00:00
Yuya Nishihara
ca797e087c fileset: enable glob matching by default
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
Since file names don't usually include glob meta characters, it's probably okay
to enable globs by default. There's also a plan to change the default of string
patterns to globs.

The short forms "cwd:"/"root:" are still aliased to literal patterns. I don't
have a strong reason to rename these.

Closes #6971
2025-11-12 11:27:41 +00:00
Yuya Nishihara
d06ab5abb9 fileset: add prefix glob patterns
"prefix-glob:" will be the default. I don't think these prefix glob patterns
are useful, but they are added for completeness.

It's odd that literal patterns do prefix matching by default whereas globs match
exactly. We can instead rename the existing "glob:" to "file-glob:" and add
prefix "glob:", but I'm not sure which is better.
2025-11-12 11:27:41 +00:00
Yuya Nishihara
bb2647d687 matchers: add prefix matching support to GlobsMatcher
This will be used as a default matcher for patterns including glob characters. I
don't think prefix matching on globs would be particularly useful, but the
default behavior should be compatible with PrefixMatcher.

Regarding the implementation, a glob regex is first translated to a prefix
pattern by replacing $ with (/|$). We can instead use low-level regex_automata
API to compute prefix matching, but that would be more involved.
GlobMatcher::visit() is slightly optimized as we know descendant paths always
match.
2025-11-12 11:27:41 +00:00
Yuya Nishihara
9a69cf370a matchers: extract Visit::Specific { All, All } to private constant
Tests for glob matching use this extensively.
2025-11-12 11:27:41 +00:00
Joseph Lou
3f486f3f82 template: Add RepoPath.absolute() method
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-11-11 03:55:51 +00:00
Björn Kautler
f0b52724f1 docs: clarify substr index meaning 2025-11-11 01:01:18 +00:00
Tejas Sanap
7b32e10ffa cli: jj absorb warns when fileset doesn't exist 2025-11-10 22:56:32 +00:00
Tejas Sanap
9bc596ce6d cli: jj fix warns when fileset doesn't exist 2025-11-10 22:56:32 +00:00
Tejas Sanap
cbfdb45c03 cli: jj interdiff warns when fileset doesn't exist 2025-11-10 22:56:32 +00:00
Tejas Sanap
10c6641939 cli: jj log warns when fileset doesn't exist
We inline `print_unmatched_explicit_paths` when displaying the log as graph
for performance reasons.
2025-11-10 22:56:32 +00:00
Tejas Sanap
fc65d35306 cli: jj resolve warns when fileset doesn't exist 2025-11-10 22:56:32 +00:00
Tejas Sanap
a68651dac8 cli: jj restore warns when fileset doesn't exist 2025-11-10 22:56:32 +00:00
Tejas Sanap
0c6529d1cc cli: jj split warns when fileset doesn't exist 2025-11-10 22:56:32 +00:00
Tejas Sanap
d5355b4135 cli: jj squash warns when fileset doesn't exist 2025-11-10 22:56:32 +00:00
Tejas Sanap
731d75b251 cli: jj status warns when fileset doesn't exist 2025-11-10 22:56:32 +00:00
Tejas Sanap
e2d6ba6a37 cli: always check if explicit_paths is empty
We should not display any warning if `explicit_paths` is empty.
Previously, we would by-pass this check if `trees` was empty (which was
incorrect behaviour).
2025-11-10 22:56:32 +00:00
Jonas Greitemann
47553b5d6d completion: normalize file paths to forward slashes
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
Fixes #7024.

On Windows, where the native path separator is `\`, either `/` or `\`
can be used (at least in PowerShell which's supported by clap-complete).
To ensure that the input string indeed prefixes the candidate paths,
we now normalize both to use forward slashes. The remainder which is
spliced onto the input string will thus use forward slashes on all
platforms. That way, the completion is now also usable in git-bash.exe
(Git for Windows with `COMPLETE=bash`). When using dynamic completion
with PowerShell, the completion results are still valid, as PowerShell
can tolerate forward slashes.
2025-11-10 19:59:25 +00:00
Jonas Greitemann
b7233249d1 completion: avoid panic when completing non-normal paths
Fixes #6861.

In the original `dir_prefix_from` function, `current` might not be a
prefix of the (normal) completion candidate `path` if `current` itself
is non-normal. In case `current` is longer than the candidate `path`,
the code previously panicked. The tests have been extended to trigger
this panic.

This commit rewrites how the file-path completion is determined from
a potentially non-normal `current_prefix`. The panic is avoided by
using `strip_prefix()` instead of direct slicing. The basic idea is to
normalize the `current_prefix` first to obtain an actual prefix of the
(normal) `path`. The remainder can then be spliced onto the original
`current_prefix` to form a non-normalized completion path that is
prefixed by `current_prefix`, allowing the shell to accept it.

This requires a different API for the helper than what `dir_prefix_from`
provided. The latter assumed that when `None` was returned, `path` could
be completed as-is; a `Some` value indicated a partial completion of
`path` to the next directory. This is no longer sufficient as we need to
potentially return a different, non-normal path in either case.

Since we want to ignore the `mode` for directory completions, the
helper must also return the type of completion (partial/directory
or full/file). To avoid propagating this information, I instead
pass the `mode` into the helper and have it return finished
`CompletionCandidate`s. This arguably yields cleaner code on the caller
side, too.
2025-11-10 19:59:25 +00:00
Martin von Zweigbergk
d6975d426b contributing.md: add a paragraph about our reviewer bottleneck 2025-11-10 18:36:39 +00:00
dependabot[bot]
cae91c6790 github: bump the github-dependencies group with 2 updates
Bumps the github-dependencies group with 2 updates: [taiki-e/install-action](https://github.com/taiki-e/install-action) and [cachix/install-nix-action](https://github.com/cachix/install-nix-action).


Updates `taiki-e/install-action` from 2.62.45 to 2.62.49
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](81ee1d48d9...44c6d64aa6)

Updates `cachix/install-nix-action` from 31.8.2 to 31.8.3
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](456688f15b...7ec16f2c06)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.62.49
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
- dependency-name: cachix/install-nix-action
  dependency-version: 31.8.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-10 18:18:02 +00:00
dependabot[bot]
39d1f7c141 cargo: bump the cargo-dependencies group with 3 updates
Bumps the cargo-dependencies group with 3 updates: [erased-serde](https://github.com/dtolnay/erased-serde), [quote](https://github.com/dtolnay/quote) and [syn](https://github.com/dtolnay/syn).


Updates `erased-serde` from 0.4.8 to 0.4.9
- [Release notes](https://github.com/dtolnay/erased-serde/releases)
- [Commits](https://github.com/dtolnay/erased-serde/compare/0.4.8...0.4.9)

Updates `quote` from 1.0.41 to 1.0.42
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.41...1.0.42)

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

---
updated-dependencies:
- dependency-name: erased-serde
  dependency-version: 0.4.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: quote
  dependency-version: 1.0.42
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: syn
  dependency-version: 2.0.110
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-10 18:17:44 +00:00
Luke Randall
34bda5e44c cli: describe: deprecate --edit in favour of --editor 2025-11-10 16:13:07 +00:00
Luke Randall
df09d2b860 cli: commit: add --editor flag 2025-11-10 16:13:07 +00:00
Luke Randall
2e1794cbf5 cli: squash: remove -E flag and clean up code
This also removes the superfluous already_edited logic, which was
obviated by changes to the logic in #7929.
2025-11-10 16:13:07 +00:00