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

7145 commits

Author SHA1 Message Date
Martin von Zweigbergk
8d090628c3 transaction: rename mut_repo() to idiomatic repo_mut()
We had both `repo()` and `mut_repo()` on `Transaction` and I think it
was easy to get confused and think that the former returned a
`&ReadonlyRepo` but both of them actually return a reference to
`MutableRepo` (the latter obviously returns a mutable reference). I
hope that renaming to the more idiomatic `repo_mut()` will help
clarify.

We could instead have renamed them to `mut_repo()` and
`mut_repo_mut()` but that seemed unnecessarily long. It would better
match the `mut_repo` variables we typically use, though.
2024-09-07 10:51:43 -07:00
Martin von Zweigbergk
e5e95225d4 cleanup: inline some short single-use mut_repo variables 2024-09-07 10:51:43 -07:00
Martin von Zweigbergk
5fbc819fc1 cleanup: avoid some unnecessary uses of mutable repo reference 2024-09-07 10:51:43 -07:00
Yuya Nishihara
5bae3eaa74 cli: remove unneeded Display for SparseInheritance
Since it's a ValueEnum, clap knows how to stringify the default value.
2024-09-07 10:17:37 +09:00
Yuya Nishihara
b263882e4b config-schema: add signing.backend=none to the list of enum variants 2024-09-07 10:17:08 +09:00
Yuya Nishihara
c3ed3e3781 evolog: use predecessor_ids() where commit object isn't needed 2024-09-07 09:09:27 +09:00
Yuya Nishihara
25819dd1c9 evolog: inline show_predecessor_patch() 2024-09-07 09:09:27 +09:00
Yuya Nishihara
03487af192 diff: extract inter-diff helper
This isn't as primitive as show_diff() or show_patch(), but there are three
callers. Let's add a helper method to remove repo argument.
2024-09-07 09:09:27 +09:00
Yuya Nishihara
f473d7bb7e op diff: pass merged repo in to DiffRenderer
Since DiffRenderer borrows a repo, it shouldn't be constructed from the base
WorkspaceCommandHelper.
2024-09-07 09:09:27 +09:00
Yuya Nishihara
b7caaf586b op diff: pass DiffRenderer in to show_op_diff() by reference
show_op_diff() doesn't need an ownership of renderer.
2024-09-07 09:09:17 +09:00
Yuya Nishihara
5bff5cdef0 op diff: create formatter by show_op_diff() callers
This will help embed operation diffs in "op log".
2024-09-07 09:09:17 +09:00
Yuya Nishihara
ea8f543d5a op show: accept root operation by mapping empty parents to root
I'm thinking of adding an option to embed operation diffs in "op log", and
"op log" shouldn't fail at the root operation. Let's make "op diff"/"show"
also work for consistency.
2024-09-07 09:09:17 +09:00
Austin Seipp
e385653064 chore: nix flake update
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-06 17:43:05 -05:00
Austin Seipp
a31fe7f6d6 cli: implement workspace add --sparse-patterns
This flag implements three modes:

- `copy`: copy sparse patterns from parent
- `full`: do not copy sparse patterns from parent
- `empty`: clear all paths, equal to `set --clear`

This is useful for various tooling like tools that want to run a parallel
process that queries the build system (without running into locks/blocking.)

I think continuing to copy sparse patterns makes sense as the default behavior.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-06 16:22:47 -05:00
Austin Seipp
a677d2adfa security: cargo update with vuln fix for gix-path < 0.10.11
Go ahead and do a blanket update while we're here.

Advisory: <https://github.com/martinvonz/jj/security/dependabot/33>
GHSA ID: GHSA-m8rp-vv92-46c7

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-06 15:17:25 -05:00
Danny Hooper
bf543402cc cli: fix: add --include-unchanged-files flag to allow fixing as yet unchanged files
This enables workflows like "insert a commit that reformats the code in one of
my project directories".

`jj fix --include-unchanged-files` is an easy way to fix everything in the repo.

`jj fix --include-unchanged-files <file...>` fixes all of the `<files>` even if they are
unchanged.

This is mostly orthogonal to other features, so not many tests are added.

This is a significant and simple enough improvement that I think it's
appropriate to make it here instead of waiting for a `jj run`-based solution.
2024-09-06 13:50:28 -05:00
dependabot[bot]
24c4d431db cargo: bump the cargo-dependencies group with 3 updates
Bumps the cargo-dependencies group with 3 updates: [insta](https://github.com/mitsuhiko/insta), [pest](https://github.com/pest-parser/pest) and [pest_derive](https://github.com/pest-parser/pest).


Updates `insta` from 1.39.0 to 1.40.0
- [Release notes](https://github.com/mitsuhiko/insta/releases)
- [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mitsuhiko/insta/compare/1.39.0...1.40.0)

Updates `pest` from 2.7.11 to 2.7.12
- [Release notes](https://github.com/pest-parser/pest/releases)
- [Commits](https://github.com/pest-parser/pest/compare/v2.7.11...v2.7.12)

Updates `pest_derive` from 2.7.11 to 2.7.12
- [Release notes](https://github.com/pest-parser/pest/releases)
- [Commits](https://github.com/pest-parser/pest/compare/v2.7.11...v2.7.12)

---
updated-dependencies:
- dependency-name: insta
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
- dependency-name: pest
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: pest_derive
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-06 17:55:09 +02:00
Martin von Zweigbergk
3133534b32 conflicts: don't panic when a conflict marker is missing removes
Closes #2611
2024-09-05 22:09:55 -07:00
Martin von Zweigbergk
4f656f3e02 tests: test parsing conflicts with missing removes (#2611) 2024-09-05 22:09:55 -07:00
Martin von Zweigbergk
fee706dfea signing: allow disabling by setting backend to "none"
We don't seem to have a way to override the config to disable
signing. This patch lets you do that by setting
`signing.backend="none"`.
2024-09-05 21:02:22 -07:00
Ilya Grigoriev
8f603f1a9c demos: fixup, working_copy.png wasn't regenerated properly
The "redacted output" wasn't properly redacted.

Also removed extraneous comment, and added a comment since
the new PNGs are larger than I expected.
2024-09-05 20:04:43 -07:00
Yuya Nishihara
6ea46b930b op diff: resolve GraphStyle by caller, remove &CommandHelper argument
show_op_diff() has many arguments. Let's make it a bit less.
2024-09-06 09:51:10 +09:00
Yuya Nishihara
dda0980c4d graphlog: inline node_template_for_key()
It's easier to follow than function call with 3 string parameters.
2024-09-06 09:51:10 +09:00
Yuya Nishihara
36ab165b57 cli: parse graph node settings strictly 2024-09-06 09:51:10 +09:00
Yuya Nishihara
406ead241b graphlog: load settings by caller
I'll make it error out if the style name is invalid.
2024-09-06 09:51:10 +09:00
Yuya Nishihara
bd7cbaaffb graphlog: add enum describing graph style 2024-09-06 09:51:10 +09:00
Yuya Nishihara
3ad54ad38d settings: move graph node helpers to CLI
I'm going to add enum GraphStyle, and it's specific to the CLI.
node_template_for_key() will be inlined later.
2024-09-06 09:51:10 +09:00
Ilya Grigoriev
42dee7d08c demos: generate pngs 2024-09-05 17:33:46 -07:00
Ilya Grigoriev
d3b0f1b970 demos: redact one of the conflict outputs
I would prefer to shorten it instead of fully redacting, but I ran into
https://github.com/martinvonz/jj/issues/4239
2024-09-05 17:33:46 -07:00
Ilya Grigoriev
51c374e917 demo git_compat and README: repurpose the demo somewhat
It is important to mention tracking branches and listing branches. This topic is important now that `jj log` does not show branches
`jj git clone` says it fetched by default. 

The demo has become more about navigating a Git remote, so I reworded
the README accordingly, shifting the focus more to "Git remote
compatibility" and away from "We include a Git repo". Both are
important, but these skills seem important for beginners.
2024-09-05 17:33:46 -07:00
Ilya Grigoriev
12fb514736 README: mention gitoxide in addition to libgit2
This seemed worth doing while I was working on the following commit. I
also moved the sentence for the purposes of the following commit.
2024-09-05 17:33:46 -07:00
Ilya Grigoriev
1cc10783a2 demos: update demos as little as possible to regenerate them
This updates demos to the point where they can run without
warnings. Some of them become less clear, this is addressed
(where I noticed it) in follow-up commits.

Fixes #3209
2024-09-05 17:33:46 -07:00
Ilya Grigoriev
6d573ef6d7 demos: replace ImageMagkick's obsolete convert with magick
Aside: thanks to ChatGPT for helping fix the error from argument
order.
2024-09-05 17:33:46 -07:00
Yuya Nishihara
058249cc57 cli: update docs URLs to point to https://martinvonz.github.io/jj/latest/ 2024-09-06 09:22:04 +09:00
Martin von Zweigbergk
a0fae76622 cli: rename obslog to evolution-log/evolog
It seems everyone agrees that `obslog` is not an intuitive name. There
was some discussion about alternatives in #3592 and on #4146. The
alternatives included `evolution`, `evolutionlog`, `evolog`,
`rewritelog`, `revlog`, and `changelog`. It seemed like
`evolution-log`/`evolog` was the most popular option. That also
matches the command's current help text ("Show how a change has
evolved over time").
2024-09-05 13:45:17 -07:00
dependabot[bot]
e8d7909526 cargo: bump the cargo-dependencies group with 4 updates
Bumps the cargo-dependencies group with 4 updates: [clap](https://github.com/clap-rs/clap), [clap_complete](https://github.com/clap-rs/clap), [rustix](https://github.com/bytecodealliance/rustix) and [serde_json](https://github.com/serde-rs/json).


Updates `clap` from 4.5.16 to 4.5.17
- [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.16...clap_complete-v4.5.17)

Updates `clap_complete` from 4.5.24 to 4.5.26
- [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.24...clap_complete-v4.5.26)

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

Updates `serde_json` from 1.0.127 to 1.0.128
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/1.0.127...1.0.128)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-05 15:57:54 +00:00
Martin von Zweigbergk
ce04e61dd4 tests: set $COLUMNS when running CLI tests
As reported in #4394, at least `test_show_command::test_show_basic`
can fail when run with a narrow terminal. This patch sets
`COLUMNS=100` in the environment when running tests so the CLI uses
that value instead of using the width of the user's terminal.
2024-09-05 08:56:04 -07:00
Ilya Grigoriev
6f44ed4f51 cli squash: explain --into in error message for merge commits 2024-09-04 21:38:55 -07:00
Ilya Grigoriev
24c263698b readme: rename Roadmap to Development Roadmap
It seems a bit clearer to me.
2024-09-04 20:05:52 -07:00
Ilya Grigoriev
7ec0b59714 docs roadmap: add to list of all docs
This avoids an MkDocs warning.

I put it into Design Docs, since people who follow the link to the
roadmap might be interested in those.

It's not a perfect place for it, but it seems better than "Technical
Details" or "Contributing" (which might make people think that they have
to read or follow the roadmap before contributing).
2024-09-04 20:05:52 -07:00
Martin von Zweigbergk
5e620bb7ef tree: when merging files, read all sides concurrently
This should help a bit when merging files using a high-latency
backend.
2024-09-04 18:47:14 -07:00
Martin von Zweigbergk
bc06b2a442 store: make write_symlink() async 2024-09-04 18:34:11 -07:00
Martin von Zweigbergk
4a8d250f2c store: make write_file() async 2024-09-04 18:34:11 -07:00
Martin von Zweigbergk
ecb2847ef5 store: make write_tree() async 2024-09-04 18:34:11 -07:00
Martin von Zweigbergk
3136426dd6 store: make write_commit() async
This just propagates the async a little bit futher where it's easy to
do so.
2024-09-04 18:34:11 -07:00
Martin von Zweigbergk
8eb3d85b1c backend: make write methods async
This doesn't provide any benefit yet bit I think we've known for a
while that we want to make the backend write methods async. It's just
not been important to Google because we have the local daemon process
that makes our writes pretty fast. Regardless, this first commit just
changes the API and all callers immediately block for now, so it won't
help even on slow backends.
2024-09-04 18:34:11 -07: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