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

6917 commits

Author SHA1 Message Date
Austin Seipp
d4cce209d8 cli: add BUILD files
The `grammar` macro from `pest_derive` doesn't actually interpret the given file
as relative in our case, so we have to give it the fully qualified relative path
which exists in the `buck-out/` dir.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:30:01 -05:00
Austin Seipp
38fe6fcb29 lib: add BUILD files
The `grammar` macro from `pest_derive` doesn't actually interpret the given file
as relative in our case, so we have to give it the fully qualified relative path
which exists in the `buck-out/` dir.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:30:01 -05:00
Austin Seipp
6fd0844306 proc-macros: add BUILD files
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:29:48 -05:00
Austin Seipp
897786e552 gen-protos: add BUILD files
This is needed to emit the `.rs` files into the right build directory in a
follow up diff to add `BUCK` files.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:29:48 -05:00
Austin Seipp
4e68eecf96 buck: cargo<->buck sync tool
This adds a new step to the `synchronize.py` script that synchronizes
dependencies between `Cargo.toml` and `BUCK` files. In this model, Cargo remains
the source of truth.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:29:48 -05:00
Austin Seipp
d33fee54fa tools: add a script for checking workspace dependencies
buck run -v0 tools/scripts:unused_workspace_deps

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:29:48 -05:00
Austin Seipp
e56d714021 cargo: suppress warnings for cfg(buck_build)
This cfg value isn't understood by Cargo, so it needs to have the warning
suppressed by default. We could also add an entry to `build.rs` too, but not
every package has one.

To be used by upcoming diffs.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:29:48 -05:00
Austin Seipp
0e53927e97 buck: unify cargo deps with reindeer deps
This includes a very simple script to do the synchronization between the
workspace Cargo file and the Buck2-specific Cargo file, automatically.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:29:48 -05:00
Austin Seipp
d295c3d447 buck: add many reindeer fixups
Summary: These will be needed for a lot of upcoming dependencies as the Reindeer
dependencies and Cargo dependencies are unified.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:27:39 -05:00
Austin Seipp
af2610b305 buck: add initial reindeer scaffold
Summary: `buck2 build third-party//rust` works fine here.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:27:39 -05:00
Austin Seipp
d563775c1e buck: build libgit2
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:27:39 -05:00
Austin Seipp
3088b3781d buck: build libssh2
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:27:39 -05:00
Austin Seipp
9b9acb2a17 buck: build boringssl
`libgit2` requires `libssh2`, which in turn requires `openssl-sys`. OpenSSL is
notoriously hard to vendor for a number of reasons including its build system.
In contrast, while BoringSSL does not make compatibility guarantees, it is easy
to vendor and is designed to be used with Bazel.

The goal is that we can substitute BoringSSL for OpenSSL in `openssl-sys` as the
underlying library, and `libssh2` will still work.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:27:39 -05:00
Austin Seipp
948cc449b8 buck: build libz
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:27:39 -05:00
Austin Seipp
60f2a44273 buck: build zstd
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:27:39 -05:00
Austin Seipp
5547e28cea buck: repository prep work
This lays the basic groundwork to invoke buck2 in a way that barely works and
builds nothing.

The `jj.bzl` code will be used in some upcoming diffs to add `BUCK` files to the
various crates.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:27:39 -05:00
Austin Seipp
82e9884823 tools: initialize useful dotslash tools
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:26:40 -05:00
Austin Seipp
5d17ad3ee9 editor: initialize .vscode settings directory
These are basically always useful in vscode; turn them on. Note that there is an
editorconfig plugin for vscode and we do have a `.editorconfig` file but these
options aren't set due to an old intellj-rust bug.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-04 14:26:40 -05:00
Ethan Brierley
3fcb6eedfd docs(roadmap): minor typo, as should be ask 2024-09-04 20:07:04 +02:00
Martin von Zweigbergk
d002a5ad35 release version 0.21.0 2024-09-04 10:11:13 -07:00
Martin von Zweigbergk
7d274a911e docs: add link to roadmap from docs main page
The roadmap seems like something users might want to read soon after
they find the project, so a link from the main page seems useful to
me.
2024-09-04 00:03:32 -07:00
Kaleb Pace
dbb579adec cli/build-rs: remove metadata command dependency in favor of env vars
When building this project with [Nix/Crane](https://github.com/ipetkov/crane/discussions/693), if the `jj-cli` dependency is specified in `Cargo.toml` as a git-based crate, `cargo vendor` splits this workspace up into sub-crate directories, which causes `cargo metadata` to fail when searching for relative deps in the workspace root.

This commit simply changes how the crate version is determined, using Cargo's built-in environment variable [`CARGO_PKG_VERSION`](https://doc.rust-lang.org/cargo/reference/environment-variables.html)
2024-09-03 22:31:17 -07:00
Martin von Zweigbergk
250a28b5a5 docs: add a roadmap 2024-09-03 21:42:29 -07:00
Ilya Grigoriev
065870160b docs: minor fix to Markdown formatting
MkDocs did not render this list in
https://martinvonz.github.io/jj/prerelease/config/#node-style properly
before.

I don't understand the reason; we have other lists that are formatted
similarly to how this one was, and they look fine in MkDocs. This might
be a bug in one of the MkDocs extensions for lists that we use.
2024-09-03 21:31:20 -07:00
Scott Taylor
52499e84cc config: add color for renamed and copied in summary
Right now, renamed and copied files don't have any color in the output
of `jj status`, and it makes them stand out. I think it's reasonable to
color renamed files the same as modified files, since renaming is like
modifying the path, and to color copied files the same as added files,
since they're basically just added files that happen to have similar
contents to an existing file.
2024-09-03 21:33:29 -05:00
Stephen Jennings
1c672d7563 docs: Add FAQ for keeping changes to tracked files
The question "How do I avoid committing changes to files?" comes up a lot in
chat, and the solution is not obvious. It will be useful to have a description
with an example we can link to.

The wording of the similar question "How can I keep my scratch files in the
repository?" was tweaked to emphasize the difference between keeping untracked
files in the workspace and keeping changes tracked files out of published
history.
2024-09-03 17:23:58 -07:00
dependabot[bot]
8017224699 cargo: bump whoami from 1.5.1 to 1.5.2 in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [whoami](https://github.com/ardaku/whoami).


Updates `whoami` from 1.5.1 to 1.5.2
- [Changelog](https://github.com/ardaku/whoami/blob/v1/CHANGELOG.md)
- [Commits](https://github.com/ardaku/whoami/compare/v1.5.1...v1.5.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-03 12:28:55 -05:00
Martin von Zweigbergk
6fdef8bf67 cli: make WorkspaceCommandHelper keep a CommandHelper
This avoids cloning `UserSettings` and some other data. I haven't
attempted to measure the performance impact (I expect it's tiny); this
is more about clarifying that there are not multiple different
versions of these fields.
2024-09-03 08:41:24 -07:00
Martin von Zweigbergk
34425a2501 cli: make CommandHelper cheaply cloneable
This wraps all the fields in `CommandHelper` in an `Rc` so
`CommandHelper` itself becomes cheap to clone (thanks to @yuja for the
idea). I'll use that next to avoid some cloning in
`WorkspaceCommandHelper`.
2024-09-03 08:41:24 -07:00
dependabot[bot]
da7b1e9e18 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.6 to 4.4.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](834a144ee9...50769540e7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-02 14:35:48 -05:00
dependabot[bot]
7270c7dc4c cargo: bump the cargo-dependencies group with 3 updates
Bumps the cargo-dependencies group with 3 updates: [async-trait](https://github.com/dtolnay/async-trait), [indexmap](https://github.com/indexmap-rs/indexmap) and [syn](https://github.com/dtolnay/syn).


Updates `async-trait` from 0.1.81 to 0.1.82
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.81...0.1.82)

Updates `indexmap` from 2.4.0 to 2.5.0
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.4.0...2.5.0)

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

---
updated-dependencies:
- dependency-name: async-trait
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-02 14:35:33 -05:00
Yuya Nishihara
11b9888cdf refs: retry trivial resolution after merging targets
This helps resolve diverged refs by abandoning both sides:

    D  ref = [D]
    |\
    | C       C  ref = [B - D + C]
    | |       |
    B |     B |     B  ref = [B - D + A]
    |/      |/      |
    A       A       A       A  ref = [A - D + A]
2024-09-02 09:20:16 +09:00
Yuya Nishihara
982ee63ba8 rewrite: remove redundant workspace lookup from update_all_references() 2024-09-02 09:20:05 +09:00
Yuya Nishihara
38bd5fbf32 rewrite: use intersperse() to interleave new/old commit ids
This is stricter than from_legacy_from() in that wrong number of add/remove
terms will panic.
2024-09-02 09:20:05 +09:00
Yuya Nishihara
1b6617bbd7 rewrite: remove redundant branch lookup from update_all_references()
It no longer makes sense to look up branches by old_commit_id. Just loop over
branch (name, target) pairs instead.
2024-09-02 09:20:05 +09:00
Martin von Zweigbergk
781351e4d0 local_working_copy: delete obsolete comment about libgit2
We have not used libgit2 for gitignores since commit 88f7f473
(2021-05-13).
2024-08-31 19:15:28 -07:00
Yuya Nishihara
8e500c0182 rewrite: do not resolve transitive parents repeatedly when updating refs
This was quadratic before, and was super slow if thousands of commits were
abandoned.

#4352
2024-09-01 11:11:12 +09:00
Yuya Nishihara
cb16b5afd0 rewrite: ensure that rewritten refs move across divergent entries
This is closer to the original behavior before 5e8d7f8c "rewrite: update
references after rewriting all commits." References can move to divergent
commits, so they should propagate further if there are more rewrites. See
the inline comment for subtle behavior difference.

We could instead replay parent_mapping in topological order, but we would
still need to flatten abandon records.
2024-09-01 11:11:12 +09:00
Yuya Nishihara
780692c2f1 rewrite: extract new_parents() that doesn't ignore divergent entries
I'll use this in debug assertion. The extracted function is not named as
new_parents_with() because it's not really about parents.
2024-09-01 11:11:12 +09:00
Martin von Zweigbergk
cc15ecf7c7 op log: change "resolve concurrent" to "reconcile divergent"
"Concurrent" operations are not necessarily actually concurrent, so
"divergent" seems like a better name. And "reconcile" seems like a
better term for merging them, though we also sometimes use "merge".
2024-08-30 21:56:11 -07:00
dploch
f963af3f16 workspace: turn WorkspaceLoader into a trait
Like https://github.com/martinvonz/jj/pull/4189, this allows extensions the ability to load the repo in an environment where the local filesystem is not accessible. This change allows such extensions to exist at the CLI layer where jj is invoked as a subprocess, rather than a library (common in testing).
2024-08-30 13:35:52 -04:00
dependabot[bot]
e004dacb37 cargo: bump tokio from 1.39.3 to 1.40.0 in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [tokio](https://github.com/tokio-rs/tokio).


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

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-30 18:55:12 +02:00
dependabot[bot]
f9a8d78304 github: bump the github-dependencies group with 2 updates
Bumps the github-dependencies group with 2 updates: [actions/setup-python](https://github.com/actions/setup-python) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/setup-python` from 5.1.1 to 5.2.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](39cd14951b...f677139bbe)

Updates `github/codeql-action` from 3.26.5 to 3.26.6
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](2c779ab0d0...4dd16135b6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-29 16:07:17 +00:00
Yuya Nishihara
db6a58d315 store: switch in-memory cache to LRU-based HashMap to cap memory usage
I just choose "clru" because it already exists in our dependency tree thorough
gix. I don't think LRU is the best cache eviction policy for our use case (a
simpler FIFO-based one might be good enough?), but it wouldn't matter for CLI
or GUI use case. I don't see significant performance degradation with "jj log
--stat -n1000".

RwLock is replaced with Mutex since get() is inherently a mutable operation.
2024-08-29 23:33:37 +09:00
Yuya Nishihara
424623ba91 cargo: add "clru" dependency 2024-08-29 23:33:37 +09:00
Yuya Nishihara
d99a8508e4 rewrite: pass old parent ids in to mut_repo.new_parents() by slice 2024-08-29 08:59:22 +09:00
Yuya Nishihara
1fe9422a6e rewrite: deduplicate parent ids per remap iteration
If merge-heavy history was abandoned, intermediate parent chains can have tons
of duplicates, and the process explodes soon. Instead, we can skip any parent
ids that have been remapped.

We can no longer detect cycles reliably, but I think that's okay so long as
the function terminates.

Fixes #4352
2024-08-29 08:59:22 +09:00
Yuya Nishihara
d76d4a90a7 rewrite: flip inner/outer loops of mut_repo.new_parents()
This is basically a DFS to find leaf nodes. It will help omit duplicated
parent ids early.
2024-08-29 08:59:22 +09:00
dependabot[bot]
8b6bebad40 cargo: bump rustix in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [rustix](https://github.com/bytecodealliance/rustix).


Updates `rustix` from 0.38.34 to 0.38.35
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.34...v0.38.35)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-28 10:49:58 -05:00
Yuya Nishihara
5af906d924 cli: change default inline threshold of color-words diffs
I played with max-inline-alternation = 3 for a couple of weeks, and it's pretty
good. I think somewhere between 2 and 4 is good default because one or two
remove + add sequences are easy to parse.
2024-08-28 10:33:33 +09:00