8965 Commits

Author SHA1 Message Date
Winter
8eb4eb74d6 nix: disable incremental builds for the dev shell
Latest rustc nightlies seem to have broken incremental compilation [0].

I apparently have the worst luck in this department, as I've gotten multiple
ICEs within the last few hours alone. So, I'm putting future me out of
her misery.

[0]: https://github.com/rust-lang/rust/issues/139110
2025-04-10 23:06:48 +00:00
Martin von Zweigbergk
42bf17936f docs: add a style guide
#5685
2025-04-10 22:01:48 +00:00
Winter
4bd6dbe83c nix: flake update 2025-04-10 20:08:09 +00:00
Emily
8c506006b2 docs: add diagrams for jj new --after and --before 2025-04-10 19:00:34 +00:00
dependabot[bot]
6dbc1eba42 cargo: bump itertools in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [itertools](https://github.com/rust-itertools/itertools).


Updates `itertools` from 0.13.0 to 0.14.0
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-itertools/itertools/compare/v0.13.0...v0.14.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-10 17:49:02 +00:00
Yuya Nishihara
5dd64ae978 git_backend: minor cleanup in tests
We don't have to create separate temporary directories.
2025-04-10 05:10:47 +00:00
Yuya Nishihara
d16da967c9 git_backend: rename variables per git.write-change-id-header config name 2025-04-10 05:10:47 +00:00
Yuya Nishihara
c4767c3de4 git_backend: do not ignore config error at loading path 2025-04-10 05:10:47 +00:00
dependabot[bot]
22128972b0 github: bump taiki-e/install-action in the github-dependencies group
Bumps the github-dependencies group with 1 update: [taiki-e/install-action](https://github.com/taiki-e/install-action).


Updates `taiki-e/install-action` from 2.49.45 to 2.49.47
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](d4635f2de6...a48a50298f)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.49.47
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-09 18:13:45 +00:00
Martin von Zweigbergk
2ce150b6c9 cargo: run cargo update to update off of yanked crossbeam-channel 2025-04-09 17:23:29 +00:00
Benjamin Brittain
0b6d0a7a75 git_backend: derive the change ID from the git change-id header
When read/writing commits from the git-backend, populate the git commit
header with a backwards hash of the `change-id`. This should enable
preserving change identity across various git remotes assuming a
cooperative git server that doesn't strip the git header.

This feature is behind a `git.write-change-id-header` configuration flag
at least to start.
2025-04-09 16:42:56 +00:00
Emily
e5478bbf7b cargo: use gix/zlib-rs feature
This uses `zlib-rs`, a native Rust library that is comparable in
performance to `zlib-ng`. Since there’s no complicated C build
and gitoxide only has one hashing backend now, this lets us drop our
`packaging` feature without adding any awkward build requirements.

`zlib-rs` is generally faster at decompression than
`zlib-ng`, and faster at compression on levels 6 and 9; see
<https://trifectatech.org/blog/zlib-rs-is-faster-than-c/>
for details.

I couldn’t get reliable‐looking benchmark results out of my
temperamental laptop; `hyperfine` seemed to think that some random
`jj` workloads I tested might be slightly slower than with `zlib-ng`,
but it wasn’t unambiguously distinguishable from noise, so I’d
like to see measurements from others.

It’s certainly a lot faster than the previous default, and I
think it’s likely that `zlib-rs` will continue to get faster
and that it’s more than worth avoiding the headaches of a native
library with a CMake build dependency. (Though on the other hand,
if distributions move in the direction of shipping `zlib-ng` by
default, maybe there will be more motivation to make `libz-ng-sys`
support system libraries.)
2025-04-08 22:12:25 +00:00
Philip Metzger
1716b7f8d3 docs: add some more testimonials
This is cobbled together from the "new" appreciation channel and something I saw on the Rust Zulip.
2025-04-08 20:55:09 +00:00
dependabot[bot]
d92b782dad 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.28.14 to 3.28.15
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](fc7e4a0fa0...45775bd823)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.28.15
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-08 18:40:05 +00:00
Emily
333d47f5e5 git: add deprecation warnings for git.subprocess 2025-04-08 10:36:46 +00:00
Yuya Nishihara
b63ab33b10 diff: add option to render color-words diffs without materializing conflicts
The original idea was to flatten left/right conflict trees and pair up adjacent
negative/positive terms. For example, diff(A, B-C+D) could be rendered as
diff(A, B) and diff(C, D). The problem of this formalization is that one of the
diff pairs is often empty (because e.g. A=B), so the context is fully omitted.
The resulting diff(C, D) doesn't provide any notion why the hunk is conflicted,
and how it is different from A.

Instead, this patch implements diffs in which each left/right pair is compared.
In the example above, the left terms are padded, and the diffs are rendered as
diff(A, B), diff(-A, -C), diff(A, D). This appears to be working reasonably well
so long as either side is resolved or both sides have the same numbers of terms.

Closes #4062
2025-04-08 09:12:39 +00:00
Yuya Nishihara
b24efa8a8d diff: parameterize "removed"/"added" labels in color-words diffs 2025-04-08 09:12:39 +00:00
Yuya Nishihara
8af238f68a diff: test identical contents early when rendering color-words diffs
This helps extract hunk rendering function for non-materialized color-words
diffs. In conflict hunk, an identical diff pair will be omitted with "..."
marker.

This patch introduces a subtle behavior change when "ignore whitespace" options
are used. Before, "..."  wouldn't be printed if contents differ only in
whitespace. I don't think the new behavior is bad because the file header says
"Modified regular file" in that case.
2025-04-08 09:12:39 +00:00
Yuya Nishihara
4ae00a6cb4 tests: add samples of conflict diff rendering 2025-04-08 09:12:39 +00:00
Yuya Nishihara
51d4f49b4c files: add iterator adaptor that splits hunks into left/right merges 2025-04-08 09:12:39 +00:00
Yuya Nishihara
6d009b3453 diff: make FileContent generic
I'll make color-words diffs optionally compare Merge<BString> without
materializing conflicts.
2025-04-08 09:12:39 +00:00
Aleksey Kuznetsov
3eaff83bca cli: Add config setting for bookmark list sort order
This is a conclusion of #5849.
Config setting to list bookmarks in specified order.

Closes #3831
2025-04-08 08:06:29 +00:00
Martin von Zweigbergk
3e51038dc5
release: merge 0.28 release branch into main 2025-04-07 22:04:11 -07:00
Winter
e77f5cea6d github: don't explicitly set contents: read for zizmor check
It's implied for public repositories.
2025-04-08 03:26:10 +00:00
Yuya Nishihara
af4f7a7811 cli: describe: reuse author field set to temporary builders
I originally thought we could remove args.reset_author tests in later pass, but
we can't because author timestamp may be updated if a commit is discardable.
Still it's nice that we can deduplicate some logic.
2025-04-08 02:11:53 +00:00
Yuya Nishihara
a7227b959f cli: describe: build temporary commit builders unconditionally
This should help implement trailer handling, in which the trailer template
should see the new author as well as the committer.
2025-04-08 02:11:53 +00:00
Yuya Nishihara
38ecdcf62e files: add functions that return merge result as Merge<_>/Option<_>
The version that returns Merge<_> will be used in diff functions. The added
helper functions will also be used in order to apply word-level merging.

Since we cannot express FnOnce(impl IntoIterator<..>) where the argument type is
controlled by callee, this patch adds helper trait to bridge collect_*()
functions.
2025-04-08 01:35:55 +00:00
Yuya Nishihara
624cb66210 files: rename merge() to merge_hunks()
I'll add new merge() function that returns the result as Merge<BString>.
2025-04-08 01:35:55 +00:00
Yuya Nishihara
8b32eafb9a files: extract iterator from merge_hunks()
This helps implement variants of file::merge() that return Merge<BString> or
Option<BString>. collect_hunks() could be implemented as FromIterator for
MergeResult. It would enable .collect(), but I don't think this abstraction
would generally be useful. The other types to which we want to collect the
outcome is Option<BString> and Merge<BString>. They could technically implement
FromIterator, but it would be weird if .collect() into Merge<BString> panicked
because of incompatible merge shapes.

Merge::resolved() is marked as const fn to clarify it is a trivial constructor.
2025-04-08 01:35:55 +00:00
Yuya Nishihara
7a7e62c0c4 files: document merge() function and result type, rename parameter
I'm going to add variants of this function.
2025-04-08 01:35:55 +00:00
Yuya Nishihara
10328967a1 tests: remove files::merge() wrapper, construct Merge in alternate form 2025-04-08 01:35:55 +00:00
Yuya Nishihara
8b949f7e93 tests: use indoc! {""} to format multi-line merge inputs 2025-04-08 01:35:55 +00:00
Remo Senekowitsch
5a50e49d70 docs: update list of builtin merge tools 2025-04-08 01:17:27 +00:00
Austin Seipp
907c62018b cargo: update prost to 0.13.5
We haven't updated `prost` in a while, and the reason for that is
probably because the code generation output slightly changed, which
would have caused dependabot to exclude that package from its updates as
a failure. (At least, I suspect that's what happened.)

This lets us drop a dependency on `itertools 0.12.x` because the prost
0.13.5 release weakened its constraints, allowing `itertools 0.13.x`.
Now we only depend on two major versions of itertools (0.10 + 0.12)
instead of three (previously four).

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-04-08 01:02:25 +00:00
Ilya Grigoriev
5dc9da3c2b cargo: general cargo update 2025-04-07 19:38:29 +00:00
dependabot[bot]
977ea23cb6 github: bump the github-dependencies group with 2 updates
Bumps the github-dependencies group with 2 updates: [taiki-e/install-action](https://github.com/taiki-e/install-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `taiki-e/install-action` from 2.49.44 to 2.49.45
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](f1390fd0d8...d4635f2de6)

Updates `github/codeql-action` from 3.28.13 to 3.28.14
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](1b549b9259...fc7e4a0fa0)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.49.45
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
- dependency-name: github/codeql-action
  dependency-version: 3.28.14
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-07 19:02:15 +00:00
dependabot[bot]
2314acf710 cargo: bump the cargo-dependencies group with 2 updates
Bumps the cargo-dependencies group with 2 updates: [indexmap](https://github.com/indexmap-rs/indexmap) and [tokio](https://github.com/tokio-rs/tokio).


Updates `indexmap` from 2.8.0 to 2.9.0
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/main/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.8.0...2.9.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-07 18:21:05 +00:00
Martin von Zweigbergk
40d9256a11 fix: make FileFixer::fix_files() take &mut self
It can be useful for fixers to record some information about the
inputs they processed. For example, the `FileFixer` we use in our
server at Google get more detailed error information back from its
formatter tools. We may want to record these errors in our
`FileFixer`'s state so we can then return that to the client.
2025-04-07 15:43:47 +00:00
Yuya Nishihara
b9ebe2f03c release: 0.28.2 v0.28.2 2025-04-07 08:42:32 -07:00
Yuya Nishihara
75d3a8c953 cargo: bump tokio to 1.44.2
https://rustsec.org/advisories/RUSTSEC-2025-0023
2025-04-07 08:42:32 -07:00
Yuya Nishihara
a5d672ca0f cargo: bump gix and its dependencies recursively
This should fix git::import_refs() issue with gix 0.71.0. Old commits could be
repopulated by importing stale refs stored in packed-refs.

https://github.com/GitoxideLabs/gitoxide/issues/1928

The Zlib license is added to the allow list because foldhash appears in the
dependency chain.
2025-04-07 08:42:32 -07:00
Philip Metzger
1b7fda946e docs: Add Jujutsu's Developers core values
This was taken out of the "Jujutsu from first principles" doc in another PR. It represents some of the common ideas
which the project had around a year ago.

I think this can be modernized if the maintainers want it.
2025-04-07 13:44:02 +00:00
Yuya Nishihara
30134e523b cargo: bump gix and its dependencies recursively
This should fix git::import_refs() issue with gix 0.71.0. Old commits could be
repopulated by importing stale refs stored in packed-refs.

https://github.com/GitoxideLabs/gitoxide/issues/1928

The Zlib license is added to the allow list because foldhash appears in the
dependency chain.
2025-04-06 10:59:40 +00:00
Emily
75bad02aec github: give the dragon a promotion
I think this check will only be useful if it actually blocks the
build. Since the resolution is simple (just bump the limit), I think
it’s okay to add a small amount of friction and ask people to take
a moment to consider other options first.
2025-04-05 17:53:39 +00:00
George Christou
47b7717e69 cli show: add --no-patch flag 2025-04-05 16:41:32 +00:00
Benjamin Tan
4b03108c19 rewrite: move_commits: use MutableRepo::transform_commits
This allows the removal of some duplicated code which performs the
topological sorting of commits to be moved.
2025-04-05 16:03:03 +00:00
Benjamin Tan
2a647e6911 repo: MutableRepo: add transform_commits function
This function is similar to `transform_descendants_with_options`, but
only rewrites the given commits and not their descendants. This will
allow `rewrite::move_commits` to transform a given set of commits
without iterating through their descendants twice (once when computing
new parents and once when rewriting commits).
2025-04-05 16:03:03 +00:00
Benjamin Tan
61ef7d9af3 repo: MutableRepo::transform_descendants_with_options: add new_parents_map
The `new_parents_map` will allow the parents of each commit to be
customized before the `transform_descendents` callback is invoked. This
is useful when the order of commits needs to be changed, whereby setting
the new parents in the default callback might lead to repeated rebasing
and cycles if the new parent has not been visited in the reverse
topological order traversal.
2025-04-05 16:03:03 +00:00
Benjamin Tan
17386f59ed repo: MutableRepo: split find_descendants_to_rebase into two functions
`MutableRepo::find_descendants_to_rebase` was finding descendants to
rebase, and ordering them. This is now split into two functions.
2025-04-05 16:03:03 +00:00
Remo Senekowitsch
b85bfa7221 cli: bookmark: list: update hint about deleted bookmarks
Deleting bookmarks now requires the --deleted flag.
(since: fb1a27ff09d2466f96316c0b894e2116dfb80b23 )
2025-04-05 14:04:54 +00:00