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

7088 commits

Author SHA1 Message Date
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
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