Commit graph

7604 commits

Author SHA1 Message Date
Shane Sveller
23a89f0d61 nix: Add explicit flake input for nixpkgs
Previous source of truth:
895a65f8d5/flake-registry.json (L302-L311)
2024-12-05 16:13:30 -06:00
Martin von Zweigbergk
32d2a85539 release: release version 0.24.0
Some checks failed
binaries / Build binary artifacts (push) Has been cancelled
nix / flake check (push) Has been cancelled
build / build (, macos-13) (push) Has been cancelled
build / build (, macos-14) (push) Has been cancelled
build / build (, ubuntu-latest) (push) Has been cancelled
build / build (, windows-latest) (push) Has been cancelled
build / build (--all-features, ubuntu-latest) (push) Has been cancelled
build / Build jj-lib without Git support (push) Has been cancelled
build / Check protos (push) Has been cancelled
build / Check formatting (push) Has been cancelled
build / Check that MkDocs can build the docs (push) Has been cancelled
build / Check that MkDocs can build the docs with latest Python and uv (push) Has been cancelled
build / cargo-deny (advisories) (push) Has been cancelled
build / cargo-deny (bans licenses sources) (push) Has been cancelled
build / Clippy check (push) Has been cancelled
Codespell / Codespell (push) Has been cancelled
website / prerelease-docs-build-deploy (ubuntu-latest) (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
2024-12-04 12:46:44 -08:00
Shane Sveller
5553baf540 cli: git push: describe private commits that would fail push 2024-12-04 13:12:30 -06:00
dependabot[bot]
644e5f0c43 cargo: bump the cargo-dependencies group with 4 updates
Bumps the cargo-dependencies group with 4 updates: [anyhow](https://github.com/dtolnay/anyhow), [clap](https://github.com/clap-rs/clap), [thiserror](https://github.com/dtolnay/thiserror) and [tokio](https://github.com/tokio-rs/tokio).


Updates `anyhow` from 1.0.93 to 1.0.94
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.93...1.0.94)

Updates `clap` from 4.5.21 to 4.5.22
- [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.21...clap_complete-v4.5.22)

Updates `thiserror` from 2.0.3 to 2.0.4
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/2.0.3...2.0.4)

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

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-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-12-04 13:03:47 -06:00
dependabot[bot]
4a5673dc33 github: bump EmbarkStudios/cargo-deny-action
Bumps the github-dependencies group with 1 update: [EmbarkStudios/cargo-deny-action](https://github.com/embarkstudios/cargo-deny-action).


Updates `EmbarkStudios/cargo-deny-action` from 2.0.3 to 2.0.4
- [Release notes](https://github.com/embarkstudios/cargo-deny-action/releases)
- [Commits](2d8c9929d8...e2f4ede4a4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-04 13:02:16 -06:00
Martin von Zweigbergk
7618b52b79 cli: consider "JJ:" lines as comments also when not followed by space
We currently ignore lines prefixed with "JJ: " (including the space)
in commit messages and in the list of sparse paths from `jj sparse
edit`. I think I included the trailing space in the prefix simply
because that's how we render comments line we insert before we ask the
user to edit the file. However, as #5004 says, Git doesn't require a
space after their "#" prefix. Neither does Mercurial after their "HG:"
prefix. So let's follow their lead and not require the trailing
space. Seems useful especially for people who have their editor
configured to strip trailing spaces.
2024-12-04 10:40:56 -08:00
Scott Taylor
fa7d9c09fc merge_tools: add merge-conflict-exit-codes option
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
nix / flake check (push) Waiting to run
build / build (, macos-13) (push) Waiting to run
build / build (, macos-14) (push) Waiting to run
build / build (, ubuntu-latest) (push) Waiting to run
build / build (, windows-latest) (push) Waiting to run
build / build (--all-features, ubuntu-latest) (push) Waiting to run
build / Build jj-lib without Git support (push) Waiting to run
build / Check protos (push) Waiting to run
build / Check formatting (push) Waiting to run
build / Check that MkDocs can build the docs (push) Waiting to run
build / Check that MkDocs can build the docs with latest Python and uv (push) Waiting to run
build / cargo-deny (advisories) (push) Waiting to run
build / cargo-deny (bans licenses sources) (push) Waiting to run
build / Clippy check (push) Waiting to run
Codespell / Codespell (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-latest) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Some Git merge drivers can partially resolve conflicts, leaving some
conflict markers in the output file. In that case, they exit with a code
between 1 and 127 to indicate that there was a conflict remaining in the
file (since Git uses a shell to run the merge drivers, and shells often
use exit codes above 127 for special meanings such as exiting due to a
signal):

https://git-scm.com/docs/gitattributes#_defining_a_custom_merge_driver

We should support this convention as well, since it will allow many Git
merge drivers to be used with Jujutsu, but we don't run our merge tools
through a shell, so there is no reason to treat exit codes 1 through 127
specially. Instead, we let the user specify which exact exit codes
should indicate conflicts. This is also better for cross-platform
support, since Windows may use different exit codes than Linux for
instance.
2024-12-03 20:08:31 -06:00
Yuya Nishihara
8748a1e73a config: remove merge() function which is used only in tests 2024-12-04 10:33:22 +09:00
Yuya Nishihara
4134511cfa cli: migrate remainder of Config::get() to StackedConfig::get() 2024-12-04 10:33:22 +09:00
Yuya Nishihara
548f85d62d formatter: migrate tests to be using StackedConfig 2024-12-04 10:33:22 +09:00
Yuya Nishihara
d6efd12bc8 completion: remove redundant rebuild of default config 2024-12-04 10:33:22 +09:00
Yuya Nishihara
c4eaef6dfc completion: migrate to UserSettings API
config::Config will soon be replaced with StackedConfig, and UserSettings
provides more convenient methods than StackedConfig.
2024-12-04 10:33:22 +09:00
Yuya Nishihara
0a0f8c5116 config: remove unneeded Result wrapping from resolved_config_values() 2024-12-04 10:33:22 +09:00
Yuya Nishihara
23b24120fb config: migrate resolved_config_values() to new getter API
When I wrote the original lookup function, I didn't notice that the root config
value could be accessed as &config.cache without cloning. That's the only reason
I added split_safe_prefix().
2024-12-04 10:33:22 +09:00
Yuya Nishihara
b0c7d0a7e2 cli: duplicate: parse -rREV option properly
Since "jj duplicate" interface is now quite similar to "jj rebase", it's
annoying that "-r" isn't parsed properly.
2024-12-04 08:38:44 +09:00
Remo Senekowitsch
a9d4886997 completion: teach absorb and bookmark move about revisions
These were simply forgotten in dd6479f104
2024-12-04 00:33:01 +01:00
Martin von Zweigbergk
4e125b6c2f cli: move ci alias to config file
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
nix / flake check (push) Waiting to run
build / build (, macos-13) (push) Waiting to run
build / build (, macos-14) (push) Waiting to run
build / build (, ubuntu-latest) (push) Waiting to run
build / build (, windows-latest) (push) Waiting to run
build / build (--all-features, ubuntu-latest) (push) Waiting to run
build / Build jj-lib without Git support (push) Waiting to run
build / Check protos (push) Waiting to run
build / Check formatting (push) Waiting to run
build / Check that MkDocs can build the docs (push) Waiting to run
build / Check that MkDocs can build the docs with latest Python and uv (push) Waiting to run
build / cargo-deny (advisories) (push) Waiting to run
build / cargo-deny (bans licenses sources) (push) Waiting to run
build / Clippy check (push) Waiting to run
Codespell / Codespell (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-latest) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
I would like to delete this alias altogether. By moving it to the
config to start with, users can start overriding it themselves, as
`commit` or whatever they prefer.
2024-12-03 10:37:54 -08:00
dependabot[bot]
efe23be34a 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.27.5 to 3.27.6
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](f09c1c0a94...aa57810251)

---
updated-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-12-03 10:41:49 -06:00
Yuya Nishihara
5db4f0bca0 cli: make jj desc and jj st aliases visible again
This backs out commit fd271d39ad "cli: make `jj desc` and `jj st` aliases
hidden."

As we discussed in https://github.com/martinvonz/jj/pull/4811, completion of
flags doesn't work for hidden aliases.
2024-12-03 23:10:24 +09:00
Yuya Nishihara
21a6a244b3 local_working_copy: move DirectoryToVisit closer to new snapshotter type
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
nix / flake check (push) Waiting to run
build / build (, macos-13) (push) Waiting to run
build / build (, macos-14) (push) Waiting to run
build / build (, ubuntu-latest) (push) Waiting to run
build / build (, windows-latest) (push) Waiting to run
build / build (--all-features, ubuntu-latest) (push) Waiting to run
build / Build jj-lib without Git support (push) Waiting to run
build / Check protos (push) Waiting to run
build / Check formatting (push) Waiting to run
build / Check that MkDocs can build the docs (push) Waiting to run
build / Check that MkDocs can build the docs with latest Python and uv (push) Waiting to run
build / cargo-deny (advisories) (push) Waiting to run
build / cargo-deny (bans licenses sources) (push) Waiting to run
build / Clippy check (push) Waiting to run
Codespell / Codespell (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-latest) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
2024-12-03 11:13:46 +09:00
Yuya Nishihara
88c3008724 local_working_copy: move common parameters out of visit_directory() arguments
The shared lifetime looks a bit wonky, but we don't have a reason to assign
per-field lifetime right now.
2024-12-03 11:13:46 +09:00
Yuya Nishihara
1a1d36979a local_working_copy: extract immutable part of snapshot() to separate struct
I'll move common parameters to the snapshotter type.
2024-12-03 11:13:46 +09:00
Yuya Nishihara
4e2e9e9b69 local_working_copy: reorder code to place snapshot functions closer 2024-12-03 11:13:46 +09:00
Yuya Nishihara
94c6d6eaff cli: leverage new settings.get(path) in merge-tools lookup
We no longer need to clone the entire table to get around the path expression
syntax of the config crate.
2024-12-03 09:42:47 +09:00
Yuya Nishihara
13ccd92766 settings: do not store "debug.randomness-seed" in stringified form
While this is a debug option, it doesn't make sense to store an integer value
as a string. We can parse the environment variable instead. The variable is
temporarily parsed into i64 because i64 is the integer type of TOML.
toml_edit::Value doesn't implement any other integer conversion functions.
2024-12-03 09:42:47 +09:00
Yuya Nishihara
3890e426e5 settings: migrate get() to StackedConfig, rename .stacked_config to .config
The goal is to remove dependency on config::Config and replace the underlying
table type to toml_edit::Table. Other StackedConfig::merge() users will be
migrated in the next batch.
2024-12-03 09:42:47 +09:00
Yuya Nishihara
8fadac4114 config: add StackedConfig method that looks up value from all layers
This patch adds separate .get<T>(), .get_table(), and .get_value() methods
because generic value types in toml_edit don't implement Deserialize.

There's a bit of naming inconsistency right now. Low-level generic object is
called an "item", whereas mid-level generic object is called a "value". These
objects will become different types when we migrate to toml_edit.
2024-12-03 09:42:47 +09:00
Yuya Nishihara
8557a0ff0a config: add basic abstraction over &str, [&str], and &ConfigNamePathBuf
We usually look up config objects with a static name, but commands like "jj
config get" has to parse a user input as a config key. We could consolidate the
name type to &ConfigNamePathBuf, but it would be inconvenient if all callers had
to do config.get(&"..".parse()?). It's also undesirable to pass a raw user input
in to .get() as a string.

I originally considered making it support fallible conversion, but doing that
would complicate error handling path. Not all functions should return an error.
It's better to do fallible parsing at the call sites instead.

A string config name is parsed into a temporary ConfigNamePathBuf object. If the
allocation cost matters, the output path type can be abstracted.
2024-12-03 09:42:47 +09:00
Yuya Nishihara
5946ef3880 settings: forward .get_table(key) to underlying config object
This will help migrate away from config::Config. We'll probably need a better
abstraction to preserve error source indication, but let's leave that for now.

.get_table() isn't forwarded to .get::<T>() because ConfigTable won't implement
Deserialize if we migrate to toml_edit.
2024-12-03 09:42:47 +09:00
Yuya Nishihara
ba07c3bc54 config: reexport table and value types
These types will be replaced with toml_edit::Table and ::Value respectively.
2024-12-03 09:42:47 +09:00
Yuya Nishihara
824cd132cc local_working_copy: leverage iterator API of channel receiver 2024-12-03 09:39:17 +09:00
Yuya Nishihara
934a2ba478 local_working_copy: remove useless Result wrapping in snapshot() 2024-12-03 09:39:17 +09:00
Yuya Nishihara
d2c0d92fa2 local_working_copy: propagate read_dir error from snapshot() 2024-12-03 09:39:17 +09:00
Yuya Nishihara
8f55680787 local_working_copy: remove unneeded boxing of diff stream 2024-12-03 09:39:17 +09:00
dependabot[bot]
05fc855185 github: bump astral-sh/setup-uv in the github-dependencies group
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
nix / flake check (push) Waiting to run
build / build (, macos-13) (push) Waiting to run
build / build (, macos-14) (push) Waiting to run
build / build (, ubuntu-latest) (push) Waiting to run
build / build (, windows-latest) (push) Waiting to run
build / build (--all-features, ubuntu-latest) (push) Waiting to run
build / Build jj-lib without Git support (push) Waiting to run
build / Check protos (push) Waiting to run
build / Check formatting (push) Waiting to run
build / Check that MkDocs can build the docs (push) Waiting to run
build / Check that MkDocs can build the docs with latest Python and uv (push) Waiting to run
build / cargo-deny (advisories) (push) Waiting to run
build / cargo-deny (bans licenses sources) (push) Waiting to run
build / Clippy check (push) Waiting to run
Codespell / Codespell (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-latest) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Bumps the github-dependencies group with 1 update: [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv).


Updates `astral-sh/setup-uv` from 4.1.0 to 4.2.0
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](5f42d5af6c...38f3f10444)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 13:45:17 -06:00
dependabot[bot]
1783c69799 cargo: bump the cargo-dependencies group with 3 updates
Bumps the cargo-dependencies group with 3 updates: [indexmap](https://github.com/indexmap-rs/indexmap), [syn](https://github.com/dtolnay/syn) and [tracing-subscriber](https://github.com/tokio-rs/tracing).


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

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

Updates `tracing-subscriber` from 0.3.18 to 0.3.19
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.3.18...tracing-subscriber-0.3.19)

---
updated-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
- dependency-name: tracing-subscriber
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 13:44:47 -06:00
Ilya Grigoriev
1f554e801f cli util gc: document the fact that evolution log limits gc
This is a followup to the discussion in
https://github.com/martinvonz/jj/pull/4953#discussion_r1855328098
2024-12-02 09:09:57 -08:00
Yuya Nishihara
e5de0fc742 cargo: bump gix to 0.68.0
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
nix / flake check (push) Waiting to run
build / build (, macos-13) (push) Waiting to run
build / build (, macos-14) (push) Waiting to run
build / build (, ubuntu-latest) (push) Waiting to run
build / build (, windows-latest) (push) Waiting to run
build / build (--all-features, ubuntu-latest) (push) Waiting to run
build / Build jj-lib without Git support (push) Waiting to run
build / Check protos (push) Waiting to run
build / Check formatting (push) Waiting to run
build / Check that MkDocs can build the docs (push) Waiting to run
build / Check that MkDocs can build the docs with latest Python and uv (push) Waiting to run
build / cargo-deny (advisories) (push) Waiting to run
build / cargo-deny (bans licenses sources) (push) Waiting to run
build / Clippy check (push) Waiting to run
Codespell / Codespell (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-latest) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
2024-12-02 00:33:35 +09:00
Yuya Nishihara
9b8a42cd4f cargo: bump thiserror to 2.0.3
There are breaking changes in derive syntax, but appears that we don't have any
bad parameter forms.

https://github.com/dtolnay/thiserror/releases/tag/2.0.0
2024-12-02 00:33:35 +09:00
Essien Ita Essien
694dfb8722 jj-lib: abstract a lower-level api for fetching from git.
* GitFetch{} separates `fetch()` from `import_refs()`.
* This allows more control over the stages of the fetch so multiple fetches
  can happen before `import_refs` resolves the changes in the local jj repo.
* Implement `git::fetch` in terms of the new api.
* Add a test case for initial fetch from a repo without `HEAD` set. This tests
  the default branch retrieving behaviour.

Issue: #4923
2024-12-01 12:22:09 +00:00
Remo Senekowitsch
a8c35db43d completion: suggest file paths incrementally
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
nix / flake check (push) Waiting to run
build / build (, macos-13) (push) Waiting to run
build / build (, macos-14) (push) Waiting to run
build / build (, ubuntu-latest) (push) Waiting to run
build / build (, windows-latest) (push) Waiting to run
build / build (--all-features, ubuntu-latest) (push) Waiting to run
build / Build jj-lib without Git support (push) Waiting to run
build / Check protos (push) Waiting to run
build / Check formatting (push) Waiting to run
build / Check that MkDocs can build the docs (push) Waiting to run
build / Check that MkDocs can build the docs with latest Python and uv (push) Waiting to run
build / cargo-deny (advisories) (push) Waiting to run
build / cargo-deny (bans licenses sources) (push) Waiting to run
build / Clippy check (push) Waiting to run
Codespell / Codespell (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-latest) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
If there are multiple files in a subdirectory that are candidates for
completion, only complete the common directory prefix to reduce the number of
completion candidates shown at once.

This matches the normal shell completion of file paths.
2024-12-01 11:06:36 +01:00
Yuya Nishihara
0ca6f00421 merged_tree: slightly adjust doc comment of inner trees() helpers 2024-11-30 10:20:43 +09:00
Yuya Nishihara
4931b2ba04 merged_tree: remove redundant .clone() from TreeDiffStreamImpl::new() 2024-11-30 10:20:43 +09:00
Yuya Nishihara
c741e3db39 merged_tree: use Merge<Tree> to represent pending trees in TreeDiffStreamImpl
This seems a slightly better in that MergedTree no longer represent a subtree.
2024-11-30 10:20:43 +09:00
Yuya Nishihara
991b0e8b68 merged_tree: keep Arc<Store> globally in TreeDiffStreamImpl
I'll replace treeN: MergedTree with Merge<Tree>, and it's simpler to just
keep the store by TreeDiffStreamImpl.
2024-11-30 10:20:43 +09:00
Yuya Nishihara
a3ca6c6f46 tests: do not pass in commit objects loaded from different store
For the same reason as 37c41d0eaf.
2024-11-30 10:20:43 +09:00
dependabot[bot]
aef61a6045 github: bump astral-sh/setup-uv in the github-dependencies group
Bumps the github-dependencies group with 1 update: [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv).


Updates `astral-sh/setup-uv` from 4.0.0 to 4.1.0
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](d8db0a86d3...5f42d5af6c)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-30 10:12:06 +09:00
Yuya Nishihara
36e83ed260 cli: move get_new_config_file_path() to commands::config
There aren't any other callers internally, and it is a thin wrapper around
ConfigEnv functions which can be easily implemented.
2024-11-30 10:01:35 +09:00
Yuya Nishihara
e1cd1a00e6 config: update comment about new config file creation
Spotted while updating get_new_config_file_path() callers. "jj config path"
isn't a command to create new config file.
2024-11-30 10:01:35 +09:00
Yuya Nishihara
ecf25a1d9b tests: extract helper that instantiates StackedConfig with commit timestamp 2024-11-30 10:01:05 +09:00