ok/jj
1
0
Fork 0
forked from mirrors/jj
Commit graph

6732 commits

Author SHA1 Message Date
Waleed Khan
34bcda651f wip: git status-based fsmonitor 2024-08-08 18:40:32 -07:00
dependabot[bot]
205334098a cargo: bump serde in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [serde](https://github.com/serde-rs/serde).


Updates `serde` from 1.0.204 to 1.0.205
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.204...v1.0.205)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-08 18:44:24 +02:00
Yuya Nishihara
2cb7e91dc7 merged_tree: do not re-look up non-conflicting tree values by name
While measuring file(path) query, I noticed BTreeMap lookup appears in perf.
It actually has a measurable cost if the history is linear and parent trees
don't have to be merged dynamically. For merge-heavy history, the cost of
tree merges is more significant. I'll address that separately.

```
% hyperfine --sort command --warmup 3 --runs 50 -L bin jj-1,jj-2 \
  'target/release-with-debug/{bin} -R ~/mirrors/git --ignore-working-copy \
   log -r "::trunk() & ~merges() & file(root:builtin)" --no-graph -n100'
Benchmark 1: target/release-with-debug/jj-1 ..
  Time (mean ± σ):     239.7 ms ±   7.1 ms    [User: 192.1 ms, System: 46.5 ms]
  Range (min … max):   222.2 ms … 249.7 ms    50 runs

Benchmark 2: target/release-with-debug/jj-2 ..
  Time (mean ± σ):     201.7 ms ±   6.9 ms    [User: 153.7 ms, System: 46.6 ms]
  Range (min … max):   184.2 ms … 211.1 ms    50 runs

Relative speed comparison
        1.19 ±  0.05  target/release-with-debug/jj-1 ..
        1.00          target/release-with-debug/jj-2 ..
```
2024-08-09 00:17:37 +09:00
Yuya Nishihara
9fb9e732c1 git: resolve relative core.excludesFile path at workspace root
The "git" command appears to chdir() to the --work-tree directory first, then
read() the core.excludesFile file. There's no manual relative path resolution
in "git".

Fixes #4222
2024-08-08 23:05:46 +09:00
Yuya Nishihara
19b62d29ba merged_tree: leverage .to_tree_merge() in TreeDiffIterator 2024-08-08 23:05:37 +09:00
Yuya Nishihara
6fc7cec4a5 merged_tree: make TreeDiffIterator accept trees as &Merge<Tree>
For the same reason as the patch for TreeEntriesIterator. It's probably
better to assume that MergedTree represents the root tree.
2024-08-08 23:05:37 +09:00
Yuya Nishihara
9378adedb7 merged_tree: hold store globally by TreeDiffIterator
Since TreeDiffDirItem is now calculated eagerly, it doesn't make sense to
keep MergedTree in it.
2024-08-08 23:05:37 +09:00
Yuya Nishihara
37c41d0eaf tests: do not pass in commit objects loaded from different store
Otherwise the assertion would fail in the next patch.
2024-08-08 23:05:37 +09:00
Yuya Nishihara
8b72dad095 merged_tree: replace explicit .is_tree() call in TreeEntriesIterator
The value here shouldn't be absent, so .is_tree() is equivalent to
.to_tree_merge().is_some().
2024-08-08 23:05:37 +09:00
Yuya Nishihara
12434b49b8 merged_tree: make TreeEntriesIterator accept trees as &Merge<Tree>
Suppose we add copy information to MergedTree, a MergedTree can be considered
a root tree representation plus global metadata. I think Merge<Tree> is a better
type for sub trees.
2024-08-08 23:05:37 +09:00
Yuya Nishihara
8a3e4ad966 merged_tree: hold store globally by TreeEntriesIterator
Since TreeEntriesDirItem is now calculated eagerly, it doesn't make sense to
keep MergedTree in it.
2024-08-08 23:05:37 +09:00
Martin von Zweigbergk
ec7725064b merged_tree: make MergedTree a struct
I considered making `MergedTree` just a newtype (1-tuple) but I went
with a struct instead because we may want to add copy information in a
separate field in the future.
2024-08-08 05:32:16 -07:00
Martin von Zweigbergk
7596935285 merged_tree: make ConflictIterator a struct 2024-08-08 05:32:16 -07:00
Martin von Zweigbergk
109391f9c7 merged_tree: delete MergedTree::Legacy 2024-08-08 05:32:16 -07:00
Martin von Zweigbergk
10aab1bdc3 conflicts: always promote legacy trees to merged trees
In order to remove the `MergedTree::Legacy` form, we need to stop
creating such instances. This patch removes the last place we create
them, which is in `Store::get_root_tree()`.

The main practical consequence of this change is that loading legacy
trees gets a lot slower on large repos. However, since the default log
template includes the `conflict` keyword, we ended up scanning all
paths in `jj log` anyway, so I'm not sure many people will notice.
2024-08-08 05:32:16 -07:00
Yuya Nishihara
202fb533f4 merged_tree: remove .diff() method in favor of .diff_stream()
It's unlikely we'll need the iterator version of .diff() except for testing
the stream implementation.
2024-08-08 10:45:59 +09:00
Yuya Nishihara
24b8934b14 tests: migrate .diff() callers to .diff_stream() 2024-08-08 10:45:59 +09:00
Yuya Nishihara
63e254d052 tests: use pollster instead of futures::executor::block_on()
It doesn't matter in tests and I have no preference over these, but we tend
to use .block_on().
2024-08-08 10:45:59 +09:00
Yuya Nishihara
26f744ab2d revset: use .diff_stream() in file() evaluation, handle backend error
This is the last .diff() caller in non-test code. Though it wouldn't be
important to use async version here, this change helps remove .diff() API.
2024-08-08 10:45:59 +09:00
Martin von Zweigbergk
27d8198fa1 release: release version 0.20.0
Thanks to everyone who's contributed!
2024-08-07 10:20:21 -07:00
dependabot[bot]
ed221d3327 github: bump github/codeql-action in the github-dependencies group
Bumps the github-dependencies group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.25.15 to 3.26.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](afb54ba388...eb055d739a)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-07 18:05:52 +02:00
dependabot[bot]
51b4993c18 cargo: bump tempfile in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [tempfile](https://github.com/Stebalien/tempfile).


Updates `tempfile` from 3.11.0 to 3.12.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-07 18:05:40 +02:00
Yuya Nishihara
b3ede64472 cargo: bump gix to 0.64.0
config.<type>_by_key() is merged with config.<type>().
2024-08-07 20:32:58 +09:00
Yuya Nishihara
7bdb28f1fe cli: make "op abandon" not fail with multiple op heads
Since "op abandon" just rewrites DAG, it works no matter if the heads are
merged or not. This change will help crash recovery. "op abandon
--at-op=<one-of-the-heads>" can't be used because ancestor operations would be
preserved by the other head.
2024-08-07 10:51:44 +09:00
Yuya Nishihara
399110b1fc op_walk: allow to resolve operation expression from multiple heads
I'll make "op abandon" work without merging op heads.
2024-08-07 10:51:44 +09:00
Yuya Nishihara
4e3a5de6e9 op_walk: sort current heads to stabilize multiple ops error message 2024-08-07 10:51:44 +09:00
Yuya Nishihara
8cac8fba5a cli: op diff: consolidate match arms of forward diffs
These two are equivalent. It's still restricted to zero or one removed commits
because I'm not sure how diverged changes should be rendered.
2024-08-07 10:51:23 +09:00
Yuya Nishihara
f7836aa687 cli: obslog: show diffs from all predecessors, not first predecessor
Suppose a squash node in obslog is analogous to a merge in revisions log, it
makes sense to show diffs from auto-merge (or auto-squash) parents. This
basically means a non-partial squash node no longer shows diffs.

This also fixes missing diffs at the root predecessors if there were.
2024-08-07 10:51:23 +09:00
Yuya Nishihara
83ee6489d9 tests: add partial/multi-source squashes to obslog test 2024-08-07 10:51:23 +09:00
Yuya Nishihara
c99f502c31 tests: leverage "squash -m" in obslog test 2024-08-07 10:51:23 +09:00
Yuya Nishihara
92ba6d336d cli: op diff: be more strict about multiple diff sources/destinations
As the doc comment states, this function only supports change of "a single
added and removed commit", "only a single added", or "single removed commit."
It doesn't make sense to show diffs from the parent commit ignoring multiple
removed commits for example.
2024-08-07 10:51:23 +09:00
Ilya Grigoriev
b42e94906d jj run: describe it as a stub in the help text 2024-08-06 17:51:01 -07:00
Ilya Grigoriev
132dfd30e2 describe: warn user of limitations when describing multiple commits
I think it might be nice to have this in the upcoming release, but I'd
like to warn people that their changes will be lost if they aren't
careful, and to not rely on the syntax being fixed just yet.
2024-08-06 11:28:21 -07:00
Ilya Grigoriev
6d1cc7f803 describe multiple commits: instruct user where to put commit descriptions
This seems especially helpful if the descriptions start out empty.
2024-08-06 11:28:21 -07:00
dependabot[bot]
07e9339c6a github: bump actions/upload-artifact in the github-dependencies group
Bumps the github-dependencies group with 1 update: [actions/upload-artifact](https://github.com/actions/upload-artifact).


Updates `actions/upload-artifact` from 4.3.5 to 4.3.6
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](89ef406dd8...834a144ee9)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-06 11:27:57 -07:00
Ilya Grigoriev
b2123282e8 tutorial: link to Steve Klabnik's tutorial, mention jj log -r ::
I was thinking of updating the tutorial in #4168, but conversations like [this
one on
Discord](https://discord.com/channels/968932220549103686/968932220549103689/1269803837070377076)
suggest that many people aren't reading it anyway.

So, this is an attempt to quickly patch up the most relevant things before the
upcoming release.
2024-08-06 11:27:08 -07:00
dependabot[bot]
6fc0c7bdce github: bump the github-dependencies group across 1 directory with 2 updates
Bumps the github-dependencies group with 2 updates in the / directory: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [EmbarkStudios/cargo-deny-action](https://github.com/embarkstudios/cargo-deny-action).


Updates `actions/upload-artifact` from 4.3.4 to 4.3.5
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](0b2256b8c0...89ef406dd8)

Updates `EmbarkStudios/cargo-deny-action` from 1.6.3 to 2.0.1
- [Release notes](https://github.com/embarkstudios/cargo-deny-action/releases)
- [Commits](3f4a782664...8371184bd1)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
- dependency-name: EmbarkStudios/cargo-deny-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-05 23:12:24 -07:00
Ilya Grigoriev
dd67e4921d github actions: upgrade cargo-deny-action
Stolen from Dependabot's https://github.com/martinvonz/jj/pull/4200/
2024-08-05 22:46:31 -07:00
Ilya Grigoriev
1dc0c7698d cargo-deny: add MPL-2.0 to allowed licenses
For some reason, the current version of `cargo-deny-action` does not
require it, but the one in the next commit fails if the license is
not added.
2024-08-05 22:46:31 -07:00
Ilya Grigoriev
6e7a20edd7 cargo-deny: use the new default for deny.toml
This is needed because old keys are becoming unsupported in the next
version of the `cargo-deny` action.

This was obtained as follows:
- Run `cargo deny init`
- Modify (only) the `licenses.allow` field to match what we had before.
2024-08-05 22:46:31 -07:00
Martin von Zweigbergk
417f19d58a docs: minor updates to description of branch conflicts
Closes #4220.
2024-08-05 18:20:37 -07:00
Yuya Nishihara
d061c3782f merged_tree: remove .diff_summary()
There are no non-test callers since 452fecb7c4 "cli: colorize diff summary
and sort by path."
2024-08-06 10:15:44 +09:00
Yuya Nishihara
d435a8a793 tests: compare trees without using .diff_summary()
I don't think modification types matter here. Testing paths should be good
enough.
2024-08-06 10:15:44 +09:00
Yuya Nishihara
0b1a6cd9e0 cli: allow any number of trailing dashes in "JJ: describe" line
Because a line without " -------" is allowed, it makes sense to strip other
variants like " --".
2024-08-06 10:15:32 +09:00
Yuya Nishihara
fb3e120092 cli: minor style cleanup in parse_bulk_edit_message() 2024-08-06 10:15:32 +09:00
Yuya Nishihara
f7b8a22c66 cli: remove redundant string concatenation from parse_bulk_edit_message() 2024-08-06 10:15:32 +09:00
dependabot[bot]
1d482c71b8 cargo: bump the cargo-dependencies group with 2 updates
Bumps the cargo-dependencies group with 2 updates: [dunce](https://gitlab.com/kornelski/dunce) and [tempfile](https://github.com/Stebalien/tempfile).


Updates `dunce` from 1.0.4 to 1.0.5
- [Commits](https://gitlab.com/kornelski/dunce/compare/v1.0.4...v1.0.5)

Updates `tempfile` from 3.10.1 to 3.11.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.10.1...v3.11.0)

---
updated-dependencies:
- dependency-name: dunce
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-05 18:51:04 +02:00
Yuya Nishihara
f4dd856f9f ui: do not write() to channel if builtin pager has terminated 2024-08-05 10:34:33 +09:00
Yuya Nishihara
ce2bc8d6b6 ui: include error sources in pager warning
An error in builtin pager can be nested.
2024-08-05 10:21:23 +09:00
Benjamin Tan
35b04f45dc describe: allow updating the description of multiple commits
If multiple commits are provided, the description of each commit
will be combined into a single file for editing.
2024-08-05 02:06:40 +08:00