Commit graph

9452 commits

Author SHA1 Message Date
Bryce Berger
cdcee0faae nix: flake update
Been about 2 months since the last one. This mainly bumps the flake from
rust 1.89 to 1.90.
2025-07-20 06:44:00 +00:00
Ilya Grigoriev
d9c031c35b cli completion: remove non-functional diff editors/formatters
Follows up on  https://github.com/jj-vcs/jj/pull/7009
2025-07-19 18:09:01 +00:00
Ilya Grigoriev
7dadc13458 merge-tools.toml: disable diff editing and/or viewing with tools that don't support it
This partially addresses #4549 together with the parent commits. A further
step would be to make it clearer to the users why a tool is disabled. For
now, this information is added to the comments of `merge-tools.toml`
2025-07-19 03:39:16 +00:00
Ilya Grigoriev
fedbc3017f cli merge tools: allow setting diff-args=[] to disable diff formatting with a tool
Not setting `diff-args` is equivalent to `diff-args=["$left",
"$right"]`, which I also documented here.

I couldn't decide whether the new error should be part of
`DiffRenderError`, `DiffGenerateError`, or `MergeToolError`. Since the
treatment of diff formatters is already very different from other merge
tools, I just made it a CommandError for now.
2025-07-19 03:39:16 +00:00
Ilya Grigoriev
dae9ce7677 cli merge tools: allow setting edit-args=[] to disable diff editing with a tool 2025-07-19 03:39:16 +00:00
Ilya Grigoriev
1b161321e3 cli merge tools: rename internal DiffTool type to DiffEditTool
Without this, it's easy to mistakenly think that a `DiffTool`
could be (or perhaps has to be) a diff formatting tool.
2025-07-19 03:39:16 +00:00
Ilya Grigoriev
2a221b0f8e docs config.md: explain unspecified merge-args/diff-args for a tool 2025-07-19 03:39:16 +00:00
Ilya Grigoriev
c6338a5594 cli merge_tools.toml: add diff viewing config for diffedit3 and vscode
They are not the most useful diff formatters, but they function, so
I thought it's better than making this an error in the following commits.

I also tried to clarify the comments a bit.
2025-07-19 03:39:16 +00:00
Yuya Nishihara
a0e7133256 cargo: bump gix to 0.73.0, update its dependencies
Closes #6437
Closes #6810
2025-07-19 01:51:10 +00:00
Martin von Zweigbergk
721daef0b4 store: inline tree_builder() function to callers
`Store::tree_builder()` returns a `TreeBuilder`. Almost all callers
should be using the `MergedTreeBuilder` these days. This patch
therefore removes `tree_builder()` to reduce the risk of accidentally
using it.
2025-07-18 21:36:13 +00:00
Josh Steadmon
d7fa04f510 templater: add parents() method for Operation
Add a parents() method for `Operation` template objects, copied from the
implementation for `Commit`s.

The test case added in test_operations.rs was heavily inspired by
test_commit_templates.rs:test_log_parents().

Fixes #6979
2025-07-18 17:16:09 +00:00
Philip Metzger
24e565c8de website: Add the CHANGELOG
This was requested by @lilyball on Discord. I still think we should create a blog longterm
so we can announce stuff and run surveys, but this small step won't block it.
2025-07-17 22:59:58 +00:00
Kaiyi Li
f1f1556731 local working copy: add support for EOL conversion 2025-07-17 15:36:28 +00:00
Kaiyi Li
74fb5a6096 working copy: pass UserSettings to WorkingCopyFactory
... so that later `TreeState` can query the EOL settings on
construction.
2025-07-17 15:36:28 +00:00
Martin von Zweigbergk
3b32b88e6c docs: explain how e.g. the commit_id() revset can override a bookmark 2025-07-17 06:16:31 +00:00
Evan Martin
d9b0a42a85 cli: make diff --stat fill available width
Previously, the computation for the available display width
included a padding constant, but this value was then used as
an upper bound for the width of the bar.  This meant the bar
would never fill the available screen width.
2025-07-17 02:03:16 +00:00
Evan Martin
228ea38aeb tests: make diff --stat test filenames clearer
Change the file names in the test to reflect a bit about what they're testing,
and add a test for a file that is a binary->binary modification.
2025-07-17 02:03:16 +00:00
Tyarel8
36133ced77 docs: add scoop to windows installation 2025-07-16 20:34:53 +00:00
Martin von Zweigbergk
59de83a84a cli: move desc and st aliases to config
We generally prefer to define aliases in the default config so users
can override them.
2025-07-15 06:11:28 +00:00
Stephen Jennings
4873bdb8aa fix: Revise description of how stderr is handled 2025-07-15 05:32:53 +00:00
dependabot[bot]
4201af2107 github: bump taiki-e/install-action in the github-dependencies group
---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.56.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-14 22:26:31 +00:00
dependabot[bot]
f76963aa7e cargo: bump the cargo-dependencies group with 3 updates
Bumps the cargo-dependencies group with 3 updates: [clap](https://github.com/clap-rs/clap), [clap_complete](https://github.com/clap-rs/clap) and [clap_complete_nushell](https://github.com/clap-rs/clap).


Updates `clap` from 4.5.40 to 4.5.41
- [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.40...clap_complete-v4.5.41)

Updates `clap_complete` from 4.5.54 to 4.5.55
- [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.54...clap_complete-v4.5.55)

Updates `clap_complete_nushell` from 4.5.7 to 4.5.8
- [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.7...clap_complete_nushell-v4.5.8)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.5.41
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: clap_complete
  dependency-version: 4.5.55
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: clap_complete_nushell
  dependency-version: 4.5.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-14 21:10:13 +00:00
Hubert Głuchowski
8ec0196aca status: collapse entirely untracked directories
This change makes status collapse directories which don't contain any
tracked files into one line so that large untracked directories don't
clutter up the status with loads of files.

For example for a tree like this:
```
T src/main.rs
U src/lib.rs
U tmp/a.txt
U tmp/b.txt
```

Previously the status would display these untracked paths:
```
? src/lib.rs
? tmp/a.txt
? tmp/b.txt
```

With this change it now looks like this:
```
? src/lib.rs
? tmp/
```
2025-07-14 19:41:27 +00:00
Martin von Zweigbergk
e982db8fd0 test_merged_tree: clear store caches before calling diff_stream()
This catches the bug introduced in 1b1edc7a90 (fixed in patch just
before this one).
2025-07-14 16:09:41 +00:00
Martin von Zweigbergk
25723d6956 merged_tree: finish polling tree before emitting path
In 1b1edc7a90, I missed the importance of this comment:

```
// Whenever we add an entry to `self.pending_trees`, we also add an Ok() entry
// to `self.items`.
```

The `self.items` entry was there to make sure that we wait for the
pending tree to be polled to completion, thus resulting in its entries
getting added to `self.items`. After my commit, we no longer always
add an entry to `items`, which meant that we can end up emitting
entries from a parent tree before entries in a child tree, such as
`foo/baz` before `foo/bar/qux` even though `baz` comes after `bar`.

This patch fixes the bug by instead checking in `self.pending_trees`
that there are no directories that we need to emit first. Thanks to
@yuja for the suggestion to do it this way instead.

The next patch will update the tests to catch regressions.
2025-07-14 16:09:41 +00:00
Martin von Zweigbergk
5d35eadd4e tests: make TestBackend async for more realistic testing
The `TestBackend` methods currently return their data immediately (on
the first poll), which means that if multiple futures are created and
then they're polled "concurrently", they will always return their data
in the order they're being polled. That leads to poor testing of
algortihms that poll futures concurrently, such as `TreeDiffStream`.

This patch makes `TestBackend` spawn async work to run in a tokio
runtime instead. That's enough to show a bug I introduced with my
recent refactoring of `TreeDiffStream`, except that it's also covered
up by the caching we do in `Store`. I'll fix the bug and update tests
to work around the caching next.

This slows down the jj-lib tests from 2.8 s to 3.1 s. I don't think
that matter much, given that the jj-cli tests takes > 30 s.

I tried to add a small `tokio::time::sleep()` (random up to 5 ms) but
that slowed down the property-based tests of the diff editor very
significantly (took over a minute). Maybe we could have two different
kinds of test backend or maybe make the sleep configurable in some
way. We can improve that later. The async-ness added in this patch is
sufficient for catching the diff-stream bug.
2025-07-14 16:09:41 +00:00
Martin von Zweigbergk
1a89ac8d53 merged_tree: poll trees in the order we're going to emit them
It should genenerally be better to prioritize polling trees in the
order we're going to emit their entries. For example, if we have
pending trees `zzz/` and `dir/aaa/`, it's better to poll the latter
even though we inserted the former first.

This also prepares for fixing a bug related to the order we emit. We
will then want to look up in `pending_trees` by key found in `items`.
2025-07-14 16:09:41 +00:00
Martin von Zweigbergk
ed6fa71835 merged_tree: avoid destructuring only to construct the same values 2025-07-14 16:09:41 +00:00
Martin von Zweigbergk
1fa3010807 merged_tree: remove an unnecessary async block 2025-07-14 16:09:41 +00:00
Ilya Grigoriev
13d747c807 cli completion: complete diff tools such as :git and :summary 2025-07-14 05:29:09 +00:00
Ilya Grigoriev
1161e95640 cli completion: complete --tool args for merge tools
Includes diff tools, diff editors, and merge editors.
2025-07-14 05:29:09 +00:00
Stephen Jennings
9b86159789 fix: prepend file name to stderr output
To distinguish stderr output from different invocations of fix tools,
write the file name to stderr before writing the output from the fix
tool.
2025-07-12 05:35:34 +00:00
Stephen Jennings
8c12452f97 fix: write complete stderr output at once from fix tools
Fix tools often emit information on stderr for the user to see. Since
fix tools are run in parallel and stderr is unbuffered, this information
can be jumbled together. This seems to happen especially frequently on
Windows.

This change locks stderr before writing to it so the stderr output from
a tool is written all at once.
2025-07-12 05:35:34 +00:00
Yuya Nishihara
dfddf6c431 tests: use forwarding DefaultMutableIndex::num_commits() function in tests 2025-07-12 00:04:02 +00:00
Yuya Nishihara
794d4bade9 index: remove redundant named lifetime parameter from Index::evaluate_revset() 2025-07-12 00:04:02 +00:00
Yuya Nishihara
468c18a850 object_id: make from_hex() not require utf-8 string
Also removed redundant .as_ref() from ChangeId::try_from_reverse_hex().
2025-07-12 00:03:52 +00:00
Yuya Nishihara
642bedd67f object_id: fix name resolution of derive(ContentHash) in macro expansion 2025-07-12 00:03:52 +00:00
Yuya Nishihara
ea3c1791a6 revset: soft-deprecate "all:" modifier syntax 2025-07-11 17:15:26 +00:00
Yuya Nishihara
6c8f6e9744 cli: allow "large" revsets by default
Since divergent/conflicted symbols no longer resolve to multiple revisions, it's
less scary to allow "large" revsets than before.

The config doc is removed because it's largely duplicated from the revsets doc,
and the config key will be removed.

#6016
2025-07-11 17:15:26 +00:00
Martin von Zweigbergk
51d7738112 code-of-conduct: replace @avamsi by @icorbrey as Community Leader
As we've discussed on Discord, the community would prefer the
community leaders to be people who are actively involved in the
community. Vamsi hasn't been involved lately, and Isaac has offered to
take on the role. Thanks, both!
2025-07-11 17:14:07 +00:00
Martin von Zweigbergk
d4d9881563 docs: jj diff -r is no longer an example of single-revision command 2025-07-11 17:10:00 +00:00
Martin von Zweigbergk
4558797e81 github: make macos nix flake not required for now 2025-07-11 16:50:26 +00:00
Yuya Nishihara
5666f4ac23 cli: complete: use diff template instead of parsing copied/renamed paths
I don't think the original implementation handles sorting and filtering of the
renamed source paths correctly, so I've added explicit .sort() at the end.

Fixes #6922
2025-07-10 12:42:08 +00:00
Yuya Nishihara
99e877b6a2 tests: add a few more copied/renamed files to completion sample 2025-07-10 12:42:08 +00:00
Yuya Nishihara
87aff55e7c index: inline MutableIndexSegment::add_commit()
If we add changed-files index, MutableIndex::add_commit() will have to update
both MutableIndexSegment of commits and MutableChangedFileIndexSegment or
something. It won't make much sense to add high-level .add_commit() function to
MutableIndexSegment.
2025-07-10 12:40:13 +00:00
Yuya Nishihara
f93ec31a29 index: hide CompositeIndex, IndexEntry, and IndexPosition types
These types are implementation details, and it was relatively easy to remove
test dependencies.
2025-07-10 12:40:13 +00:00
Yuya Nishihara
84a456cc1f index: replace external users of revset_engine, make it private 2025-07-10 12:40:13 +00:00
Yuya Nishihara
e4f0942f26 index: replace external users of CompositeIndex 2025-07-10 12:40:13 +00:00
Bryce Berger
a471eb9cb1 template/revset: mention tree-sitter grammar in pest file 2025-07-10 09:54:27 +00:00
Martin von Zweigbergk
6485049676 docs: include another example of .. vs :: difference
We still get many questions about the difference between `..` and
`::`. It turns out we didn't have an example of the typical case of
using `..` to find commits on a feature branch compared to the main
branch. This patch adds such an example.
2025-07-10 05:58:26 +00:00