2023-08-04 22:59:19 +00:00
|
|
|
[package]
|
|
|
|
name = "jj-cli"
|
2023-08-05 22:14:11 +00:00
|
|
|
description = "Jujutsu - an experimental version control system"
|
2023-08-04 22:59:19 +00:00
|
|
|
default-run = "jj"
|
|
|
|
|
2023-08-22 16:41:42 +00:00
|
|
|
version = { workspace = true }
|
|
|
|
edition = { workspace = true }
|
|
|
|
rust-version = { workspace = true }
|
|
|
|
license = { workspace = true }
|
|
|
|
homepage = { workspace = true }
|
|
|
|
repository = { workspace = true }
|
|
|
|
documentation = { workspace = true }
|
|
|
|
keywords = { workspace = true }
|
2023-08-05 22:14:11 +00:00
|
|
|
|
2023-08-04 22:59:19 +00:00
|
|
|
[[bin]]
|
|
|
|
name = "jj"
|
|
|
|
path = "src/main.rs"
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
name = "fake-editor"
|
|
|
|
path = "testing/fake-editor.rs"
|
2023-09-20 05:30:34 +00:00
|
|
|
required-features = ["test-fakes"]
|
2023-08-04 22:59:19 +00:00
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
name = "fake-diff-editor"
|
|
|
|
path = "testing/fake-diff-editor.rs"
|
2023-09-20 05:30:34 +00:00
|
|
|
required-features = ["test-fakes"]
|
2023-08-04 22:59:19 +00:00
|
|
|
|
|
|
|
[build-dependencies]
|
2023-08-22 16:41:42 +00:00
|
|
|
cargo_metadata = { workspace = true }
|
2023-08-04 22:59:19 +00:00
|
|
|
|
|
|
|
[dependencies]
|
2023-08-22 16:41:42 +00:00
|
|
|
chrono = { workspace = true }
|
|
|
|
clap = { workspace = true }
|
|
|
|
clap_complete = { workspace = true }
|
|
|
|
clap_mangen = { workspace = true }
|
|
|
|
config = { workspace = true }
|
2023-08-05 16:14:11 +00:00
|
|
|
criterion = { workspace = true, optional = true }
|
2023-08-22 16:41:42 +00:00
|
|
|
crossterm = { workspace = true }
|
|
|
|
dirs = { workspace = true }
|
|
|
|
esl01-renderdag = { workspace = true }
|
|
|
|
git2 = { workspace = true }
|
|
|
|
glob = { workspace = true }
|
|
|
|
hex = { workspace = true }
|
|
|
|
indexmap = { workspace = true }
|
|
|
|
itertools = { workspace = true }
|
|
|
|
jj-lib = { workspace = true }
|
|
|
|
maplit = { workspace = true }
|
|
|
|
once_cell = { workspace = true }
|
|
|
|
pest = { workspace = true }
|
|
|
|
pest_derive = { workspace = true }
|
|
|
|
regex = { workspace = true }
|
|
|
|
rpassword = { workspace = true }
|
2023-08-29 21:13:35 +00:00
|
|
|
scm-record = { workspace = true }
|
2023-08-22 16:41:42 +00:00
|
|
|
serde = { workspace = true }
|
|
|
|
slab = { workspace = true }
|
|
|
|
tempfile = { workspace = true }
|
|
|
|
textwrap = { workspace = true }
|
|
|
|
thiserror = { workspace = true }
|
|
|
|
timeago = { workspace = true }
|
|
|
|
toml_edit = { workspace = true }
|
|
|
|
tracing = { workspace = true }
|
|
|
|
tracing-chrome = { workspace = true }
|
|
|
|
tracing-subscriber = { workspace = true }
|
2023-08-31 07:42:42 +00:00
|
|
|
unicode-width = { workspace = true }
|
2023-08-04 22:59:19 +00:00
|
|
|
|
|
|
|
[target.'cfg(unix)'.dependencies]
|
2023-08-22 16:41:42 +00:00
|
|
|
libc = { workspace = true }
|
2023-08-04 22:59:19 +00:00
|
|
|
|
|
|
|
[dev-dependencies]
|
2023-08-22 16:41:42 +00:00
|
|
|
anyhow = { workspace = true }
|
backend: make read functions async
The commit backend at Google is cloud-based (and so are the other
backends); it reads and writes commits from/to a server, which stores
them in a database. That makes latency much higher than for disk-based
backends. To reduce the latency, we have a local daemon process that
caches and prefetches objects. There are still many cases where
latency is high, such as when diffing two uncached commits. We can
improve that by changing some of our (jj's) algorithms to read many
objects concurrently from the backend. In the case of tree-diffing, we
can fetch one level (depth) of the tree at a time. There are several
ways of doing that:
* Make the backend methods `async`
* Use many threads for reading from the backend
* Add backend methods for batch reading
I don't think we typically need CPU parallelism, so it's wasteful to
have hundreds of threads running in order to fetch hundreds of objects
in parallel (especially when using a synchronous backend like the Git
backend). Batching would work well for the tree-diffing case, but it's
not as composable as `async`. For example, if we wanted to fetch some
commits at the same time as we were doing a diff, it's hard to see how
to do that with batching. Using async seems like our best bet.
I didn't make the backend interface's write functions async because
writes are already async with the daemon we have at Google. That
daemon will hash the object and immediately return, and then send the
object to the server in the background. I think any cloud-based
solution will need a similar daemon process. However, we may need to
reconsider this if/when jj gets used on a server with a custom backend
that writes directly to a database (i.e. no async daemon in between).
I've tried to measure the performance impact. That's the largest
difference I've been able to measure was on `jj diff
--ignore-working-copy -s --from v5.0 --to v6.0` in the Linux repo,
which increases from 749 ms to 773 ms (3.3%). In most cases I've
tested, there's no measurable difference. I've tried diffing from the
root commit, as well as `jj --ignore-working-copy log --no-graph -r
'::v3.0 & author(torvalds)' -T 'commit_id ++ "\n"'` (to test a
commit-heavy load).
2023-09-06 19:59:17 +00:00
|
|
|
async-trait = { workspace = true }
|
2023-08-22 16:41:42 +00:00
|
|
|
assert_cmd = { workspace = true }
|
|
|
|
assert_matches = { workspace = true }
|
|
|
|
insta = { workspace = true }
|
|
|
|
test-case = { workspace = true }
|
|
|
|
testutils = { workspace = true }
|
2023-09-20 05:30:34 +00:00
|
|
|
# https://github.com/rust-lang/cargo/issues/2911#issuecomment-1483256987
|
|
|
|
jj-cli = { path = ".", features = ["test-fakes"], default-features = false }
|
2023-08-04 22:59:19 +00:00
|
|
|
|
|
|
|
[features]
|
2023-09-07 16:09:59 +00:00
|
|
|
default = ["watchman"]
|
2023-09-07 16:19:33 +00:00
|
|
|
bench = ["dep:criterion"]
|
2023-09-07 16:09:59 +00:00
|
|
|
packaging = []
|
2023-09-20 05:30:34 +00:00
|
|
|
test-fakes = []
|
2023-08-04 22:59:19 +00:00
|
|
|
vendored-openssl = ["git2/vendored-openssl", "jj-lib/vendored-openssl"]
|
|
|
|
watchman = ["jj-lib/watchman"]
|
2023-09-20 05:54:42 +00:00
|
|
|
|
|
|
|
[package.metadata.binstall]
|
|
|
|
# The archive name is jj, not jj-cli. Also, `cargo binstall` gets
|
|
|
|
# confused by the `v` before versions in archive name.
|
|
|
|
pkg-url="{ repo }/releases/download/v{ version }/jj-v{ version }-{ target }.{ archive-format }"
|