8965 Commits

Author SHA1 Message Date
Jonas Greitemann
8c4586ab09 config-schema: add sample config files to exercise schema tests
Adds a bunch of additional sample config toml files. Via the
`datatest_runner`, these each correspond to a test case to check that
the toml is correctly (in-)validated according to the schema.

The `valid/*.toml` files typically define multiple related config
options at once. Where there's some overlap with the default configs in
`cli/src/config`, the aim was to choose different allowed values, e.g.
hex colors, file size in bytes (numeric), etc.

The `invalid/*.toml` files typically only define a single offending
property such as to not obscure individual false negatives. All of the
"invalid" files are still valid toml as the aim is not to test the
`toml_edit` crate or Taplo.

The sample files all contain a Taplo schema directive. This allows them
to be validated against the schema on the fly by Taplo's LSP and derived
IDE plugins to speed up editing and immediately highlight offending
options.

Closes #5695.
2025-04-24 15:48:08 +00:00
Jonas Greitemann
d286b406e7 config-schema: use datatest-stable crate to instantiate tests
The `datatest-stable` crate allows to dynamically instantiate test cases
based on available files. This is applied to `test_config_schema` to
create one test case per config file. As case in point, the test case
for `hints.toml` was missing previously, hence the total number of tests
is up one.

This will become useful when adding more config examples to somewhat
exhaust the schema.

`datatest-stable` uses a custom test harness and thus cannot be used in
the same integration test binary that all of the other test modules run
in. However, if data-driven tests are to be used for other applications,
they can share in the same binary, so the module structure is already
set up to mirror the central "runner" approach.
2025-04-24 15:48:08 +00:00
Jonas Greitemann
8882f0016d tests: allow multiple integration tests in check for forgotton test files
The previous implementation of `assert_no_forgotten_test_files`
hard-coded the name of the `runner` integration test and required all
other source files to appear in matching `mod` declarations. Thus, this
approach cannot handle multiple integration tests.

However, additional integration tests may be desirable
- to support tests using a custom test harness (see upcoming commits)
- to balance the trade-off between test run time and compile time as
  the test suite grows in the future.

The new implementation first uses `taplo` to parse the `[[test]]`
sections of the manifest to identify integration test main modules,
and then searches in those for `mod` declarations. This is then compared
to the list of source files in the tests directory. Like the previous
implementation, the new one does not attempt to recurse into submodules
or to handle directory-style modules; just like before it only treats
source files without a module declaration as an error and relies on the
compiler to complain about the other way around.

When `taplo` is not installed, the check is skipped unless it is running
in CI where we require `taplo` to be available.
2025-04-24 15:48:08 +00:00
Jonas Greitemann
69cf7b38fc config-schema: add missing default for core.fsmonitor 2025-04-24 15:48:08 +00:00
Jonas Greitemann
b99361cbab config-schema: fix wrong "default" for ui.streampager.interface
The schema said that the default was "never" which is actually not one
of the allowed enum values.
2025-04-24 15:48:08 +00:00
Jonas Greitemann
47fba33dcd config-schema: fix a typo in the $comment field 2025-04-24 15:48:08 +00:00
Yuya Nishihara
757a08cd21 cli: rebase: consolidate call sites of move_commits() 2025-04-24 13:16:33 +00:00
Yuya Nishihara
fdaf8b9ca5 cli: rebase: remove redundant check for empty operation
move_commits() exits early if the target commits are empty.
2025-04-24 13:16:33 +00:00
Yuya Nishihara
bdedf4a958 cli: rebase: use slice pattern when constructing tx descriptions 2025-04-24 13:16:33 +00:00
Vincent Ging Ho Yim
5ba4173b45 mkdocs: enable instant loading
This allows text typed into the search box to persist across page navigation, which is
useful when users look up a term but aren't sure on which page they will eventually find
the relevant information. See the [`mkdocs-material` docs][mm-docs] for more
information.

[mm-docs]:
https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#instant-loading
2025-04-23 19:19:25 +00:00
Sam
001801a3b1 cli: add config option for built-in pager's ruler 2025-04-23 03:16:58 +00:00
Yuya Nishihara
6e5f0297e2 cli: evolog: rename variable to match the actual type
iter_nodes isn't an iterator.
2025-04-22 16:27:02 +00:00
Yuya Nishihara
853992facf cli: evolog: remove redundant Result wrapping 2025-04-22 16:27:02 +00:00
Benjamin Tan
f9c83541d6 docs: releasing: use gh api --paginate to construct contributor list 2025-04-22 15:03:23 +00:00
Yuya Nishihara
0e17c0e17d copies: ignore existing tree when testing copy/rename operation type
In this context, a tree value should be considered absent.
2025-04-22 00:44:13 +00:00
Yuya Nishihara
b6a861b529 git_backend: do not include renamed trees in copy records
We could instead make CopiesTreeDiffStream reject bad copy records, but it's
pretty much wrong to construct a FileId for tree.

Fixes #6390
2025-04-22 00:44:13 +00:00
George Christou
69135abf5b docs: update meld install command 2025-04-22 00:28:33 +00:00
Vincent Ging Ho Yim
08f9a9af43 docs/contributing: remove explicit enabling of copy button in code snippets 2025-04-21 23:12:43 +00:00
Vincent Ging Ho Yim
1de9cfe540 mkdocs: enable code copy button globally
This makes it easier to try out configs and commands mentioned in the docs.
2025-04-21 23:12:43 +00:00
Vincent Ging Ho Yim
f300371398 docs/contributing: add instructions to build the docs for offline distribution 2025-04-21 23:11:21 +00:00
Vincent Ging Ho Yim
0bb65b9082 mkdocs: enable offline plugin selectively with MKDOCS_OFFLINE environment variable
This removes the need to keep the mkdocs plugins config in sync in a separate
`mkdocs-offline.yml`.
2025-04-21 23:11:21 +00:00
Vincent Ging Ho Yim
7a281a23a6 mkdocs: enable readable anchor links for content tabs
For example, [this URL][1] becomes [this][2].

[1]: https://jj-vcs.github.io/jj/prerelease/contributing/#__tabbed_1_1
[2]: https://jj-vcs.github.io/jj/prerelease/contributing/#macoslinux
2025-04-21 19:18:11 +00:00
Vincent Ging Ho Yim
6a7f72f9fa mkdocs: sort markdown_extensions nodes lexicographically 2025-04-21 19:18:11 +00:00
dependabot[bot]
31faed3ee1 cargo: bump the cargo-dependencies group with 2 updates
Bumps the cargo-dependencies group with 2 updates: [clap](https://github.com/clap-rs/clap) and [rpassword](https://github.com/conradkleinespel/rpassword).


Updates `clap` from 4.5.36 to 4.5.37
- [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.36...clap_complete-v4.5.37)

Updates `rpassword` from 7.3.1 to 7.4.0
- [Release notes](https://github.com/conradkleinespel/rpassword/releases)
- [Commits](https://github.com/conradkleinespel/rpassword/compare/v7.3.1...v7.4.0)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.5.37
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: rpassword
  dependency-version: 7.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-21 19:17:24 +00:00
Yuya Nishihara
af9c608ca5 config: migrate ui.default-description to template alias
Since we now have the template alias, it's easy to migrate the config value
programatically. However, there are a couple of minor behavior changes:

 a. default description won't be used if user customized the
    draft_commit_description template.
 b. default description won't be inserted if trailer is added

For (a), I assumed user would inline the default description in the draft
template if they customized the template. (b) should be okay because the
trailers template is a new feature.
2025-04-21 14:39:47 +00:00
Yuya Nishihara
1525740247 docs: fix copy-paste error in draft_commit_description example 2025-04-21 14:39:47 +00:00
Martin von Zweigbergk
5ccd0dbe32 merge: make to_tree_merge() read trees concurrently 2025-04-21 13:31:45 +00:00
Yuya Nishihara
fc5f90c4ac annotate: reorganize functions as restartable process
I don't have any plan to implement incremental UI for file annotation, but I
think the new API is nicer in that they have fewer function arguments.

Note that this wouldn't help implement interactive UI to go ancestor annotation
by clicking annotated line. To achieve that cheaply, we'll need weave-like data.
2025-04-21 12:38:38 +00:00
Yuya Nishihara
5feed28f49 annotate: reorganize initialization of state to make process restartable 2025-04-21 12:38:38 +00:00
Yuya Nishihara
4a8074759c annotate: leave unresolved commits in commit_source_map
We can visit ancestors from these commits to continue annotation process.
2025-04-21 12:38:38 +00:00
Yuya Nishihara
00dd6df4d9 annotate: pack intermediate state into struct 2025-04-21 12:38:38 +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
Vincent Ging Ho Yim
8e15a2634a mkdocs: add table-reader plugin
This is used to render Markdown tables from YAML files.
2025-04-21 00:45:01 +00:00
Vincent Ging Ho Yim
e660846817 mkdocs: sort plugins nodes lexicographically 2025-04-21 00:45:01 +00:00
Vincent Ging Ho Yim
b9f83261db mkdocs: add 'Style guide' to nav sidebar 2025-04-21 00:38:01 +00:00
Martin von Zweigbergk
3c84a23b13 merge: add and use a function for mapping async functions concurrently
This adds `Merge::try_map_async()` and adds some callers.
2025-04-20 06:44:00 +00:00
Martin von Zweigbergk
ed99e21bc4 revset: rename StoreError variants to Backend
I haven't checked, but I think "store" is a holdover from a long time
ago.
2025-04-20 02:28:36 +00:00
Gaëtan Lehmann
7073811fe0 squash: don't add trailers to an empty description
ref: #6265
2025-04-19 16:25:03 +00:00
Martin von Zweigbergk
15351a2d92 templates: extract a template alias as hook for default commit description
This makes it easier to override just the default description without
having copy the whole default template (and having to keep it up to
date with new versions).
2025-04-19 05:42:52 +00:00
Yuya Nishihara
6cba6d7ec2 cli: git-push: do not move existing local bookmarks by --change
An existing "push-*" bookmark should usually be in position. If it wasn't
because of e.g split, I think the user should be aware of that and take an
explicit action.
2025-04-19 01:26:40 +00:00
Yuya Nishihara
03b37c6646 cli: git-push: extract helper function that checks bookmark name to create 2025-04-19 01:26:40 +00:00
Vincent Ging Ho Yim
183d4e1882 docs/index: use sentence case consistently for docs page names
Follow-up to 73e87bc.
2025-04-18 22:25:36 +00:00
Josh Steadmon
405331ba62 paid_contributors: sort contributor list
Make it easier to scan the list by sorting it (case-insensitive).
2025-04-18 20:30:59 +00:00
Gaëtan Lehmann
fae66ace9b split: add trailer support 2025-04-18 16:48:01 +00:00
Gaëtan Lehmann
6d240be777 squash: add trailer support 2025-04-18 16:35:16 +00:00
TimerErTim
ae1e831aa6 docs: mention openSUSE installation method 2025-04-17 18:34:12 +00:00
Yuya Nishihara
39f481f2da absorb: add basic support for file deletion
This works if the file was added and wasn't modified within the destination
range.

Closes #6140
2025-04-17 18:10:23 +00:00
Martin von Zweigbergk
e61971c1f3 repo: propagate error from edit() in update_wc_commits() 2025-04-17 14:41:50 +00:00
Gaëtan Lehmann
2a7b0211eb new: add trailer support 2025-04-17 13:29:49 +00:00