Commit graph

9789 commits

Author SHA1 Message Date
Gaëtan Lehmann
8a9c356f5e touch: add an option to generate a new change-id 2025-08-14 17:36:20 +00:00
Gaëtan Lehmann
8bc11f272c touch: add options to modify author and author timestamp 2025-08-14 17:36:20 +00:00
Gaëtan Lehmann
de74f88cfc touch: a command to modify some revision metadata 2025-08-14 17:36:20 +00:00
Martin von Zweigbergk
05a74963cd protos: rename op_store to simple_op_store
Similar to the previous commit, `op_store` is specific to
`SimpleOpStore`, so its name should match that.
2025-08-14 14:15:17 +00:00
Martin von Zweigbergk
e13a8649f3 protos: rename working_copy to local_working_copy
The `working_copy` proto is specific to `LocalWorkingCopy`, so I think
it should match that name.
2025-08-14 14:15:17 +00:00
Yuya Nishihara
ad14c7bcc0 index: concatenate changed-path index on merge_in()
The logic is different from MutableCommitIndexSegment::merge_in() because we
need to deduplicate changed-path entries based on the commit entries.
2025-08-14 08:44:55 +00:00
Yuya Nishihara
a2155dcc95 index: squash changed-path segments before saving
The logic is the same as MutableCommitIndexSegment.
2025-08-14 08:44:55 +00:00
Yuya Nishihara
01e2a85555 commit_builder: make .generate_new_change_id() not imply commit is duplicated
This will allow us to "touch" change id without duplicating commits.

The caller should also do .generate_new_change_id() to not make commits
divergent. This function could do that automatically, but I'm not sure if that's
good. Alternatively, we can add mut_repo.duplicate_commit(predecessor), but
we'll need to refactor CommitRewriter.
2025-08-14 08:44:32 +00:00
Ian Wrzesinski
1255eb6143 working_copy: Remove expect(dead_code) by adding underscore to field name 2025-08-14 05:29:12 +00:00
Ian Wrzesinski
c6ccfabf70 diff: Remove unneeded & 2025-08-14 00:52:43 +00:00
Martin von Zweigbergk
823f4fccb4 PathError: rename error field to source
`source` seems to be the more idiomatic name for the error source.
2025-08-13 17:45:52 +00:00
Kaiyi Li
f8eeed2b67 eol conversion: treat files with lone CRs as binary
When checking whether a file is binary, we check if the file exists a CR
character that isn't followed by a LF character. If so, we consider this
file as binary and don't apply EOL conversion unconditionally.

This commit is related to #7010.
2025-08-12 18:00:10 +00:00
Ilya Grigoriev
81596d61be Cargo.lock: run cargo update
Seems like a good time for it: a while before the next release,
right after a dependabot upgrade.
2025-08-12 09:47:39 +00:00
Ilya Grigoriev
9aeed9a39d clippy: run autofix to use Self more often
For some reason, running `cargo update` makes clippy notice these can
be replaced with `Self`. I put this commit first, though, since it is
helpful regardless of the update.

This is the result of the following command after the `cargo update`
from the next commit (even though the refactor is valid regardless of
the `cargo update`).

```
cargo +nightly clippy  --workspace --all-targets --all-features --fix
```
2025-08-12 09:47:39 +00:00
dependabot[bot]
e44c1e98ec cargo: bump the cargo-dependencies group with 8 updates
Bumps the cargo-dependencies group with 8 updates:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.42` | `4.5.43` |
| [clap_complete](https://github.com/clap-rs/clap) | `4.5.55` | `4.5.56` |
| [hashbrown](https://github.com/rust-lang/hashbrown) | `0.15.4` | `0.15.5` |
| [libc](https://github.com/rust-lang/libc) | `0.2.174` | `0.2.175` |
| [proc-macro2](https://github.com/dtolnay/proc-macro2) | `1.0.95` | `1.0.96` |
| [slab](https://github.com/tokio-rs/slab) | `0.4.10` | `0.4.11` |
| [rustversion](https://github.com/dtolnay/rustversion) | `1.0.21` | `1.0.22` |
| [whoami](https://github.com/ardaku/whoami) | `1.6.0` | `1.6.1` |


Updates `clap` from 4.5.42 to 4.5.43
- [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.42...clap_complete-v4.5.43)

Updates `clap_complete` from 4.5.55 to 4.5.56
- [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.55...clap_complete-v4.5.56)

Updates `hashbrown` from 0.15.4 to 0.15.5
- [Release notes](https://github.com/rust-lang/hashbrown/releases)
- [Changelog](https://github.com/rust-lang/hashbrown/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/hashbrown/compare/v0.15.4...v0.15.5)

Updates `libc` from 0.2.174 to 0.2.175
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.175/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.174...0.2.175)

Updates `proc-macro2` from 1.0.95 to 1.0.96
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.95...1.0.96)

Updates `slab` from 0.4.10 to 0.4.11
- [Release notes](https://github.com/tokio-rs/slab/releases)
- [Changelog](https://github.com/tokio-rs/slab/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/slab/compare/v0.4.10...v0.4.11)

Updates `rustversion` from 1.0.21 to 1.0.22
- [Release notes](https://github.com/dtolnay/rustversion/releases)
- [Commits](https://github.com/dtolnay/rustversion/compare/1.0.21...1.0.22)

Updates `whoami` from 1.6.0 to 1.6.1
- [Release notes](https://github.com/ardaku/whoami/releases)
- [Commits](https://github.com/ardaku/whoami/commits)

---
updated-dependencies:
- dependency-name: clap
  dependency-version: 4.5.43
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: clap_complete
  dependency-version: 4.5.56
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: hashbrown
  dependency-version: 0.15.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: libc
  dependency-version: 0.2.175
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: proc-macro2
  dependency-version: 1.0.96
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: slab
  dependency-version: 0.4.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: rustversion
  dependency-version: 1.0.22
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: whoami
  dependency-version: 1.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 02:33:37 +00:00
dependabot[bot]
bb1c34767b github: bump the github-dependencies group with 4 updates
Bumps the github-dependencies group with 4 updates: [actions/checkout](https://github.com/actions/checkout), [taiki-e/install-action](https://github.com/taiki-e/install-action), [rui314/setup-mold](https://github.com/rui314/setup-mold) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.2.2 to 5.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](11bd71901b...08c6903cd8)

Updates `taiki-e/install-action` from 2.57.6 to 2.58.9
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](6064345e66...2c73a741d1)

Updates `rui314/setup-mold` from 702b1908b5edf30d71a8d1666b724e0f0c6fa035 to 7344740a9418dcdcb481c7df83d9fbd1d5072d7d
- [Commits](702b1908b5...7344740a94)

Updates `github/codeql-action` from 3.29.7 to 3.29.8
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](51f77329af...76621b61de)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-dependencies
- dependency-name: taiki-e/install-action
  dependency-version: 2.58.9
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-dependencies
- dependency-name: rui314/setup-mold
  dependency-version: 7344740a9418dcdcb481c7df83d9fbd1d5072d7d
  dependency-type: direct:production
  dependency-group: github-dependencies
- dependency-name: github/codeql-action
  dependency-version: 3.29.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 21:04:46 +00:00
Yuya Nishihara
e31069cd3c index: index changed paths by add_commit()
Tests of the indexed contents will be added with the revset engine integration.
We don't have a public interface to get the indexed changed paths right now.
2025-08-11 11:50:39 +00:00
Yuya Nishihara
6bb26d8e73 index: include changed-path index in stats() 2025-08-11 11:50:39 +00:00
Yuya Nishihara
132d74a234 index: read/write changed-path index segments 2025-08-11 11:50:39 +00:00
Yuya Nishihara
3902d88b3e index: migrate operation link file to protobuf
I'm going to add changed-path index, and the operation link file will store a
list of segment files and a starting commit position. Suppose the link file is
small, we wouldn't need our own serialization format.

This patch adds new directory for proto-based operation link files. We could
reuse the existing directory, but that would make debugging a bit harder.
2025-08-11 11:50:39 +00:00
Yuya Nishihara
3f0126191d index: don't use persist_content_addressed_temp_file() to write operation link
A link file isn't addressed by its content but by the associated operation id.
There's no guarantee that the stored content never changes.
2025-08-11 11:50:39 +00:00
Gaëtan Lehmann
2e2127c56b log: add templates to anonymize the output 2025-08-10 19:24:36 +00:00
Gaëtan Lehmann
d526a6f0fd template: add a hash function 2025-08-10 19:24:36 +00:00
Isaac Corbrey
55764e822c cli describe: Clarify short description for --reset-author
The short description for `--reset-author` previously made no mention of
updating the author timestamp as well as the author name and email. This
change adds verbiage to clarify that.
2025-08-10 11:42:43 +00:00
Daniel Luz
5d63b11e39 cli: provide file completion for util exec args
Makes command aliases provide similar completion to the shell's default.
2025-08-10 04:10:46 +00:00
Joaquín Triñanes
a50147c23c docs: fix nested list rendering as top level
While the generated markdown is correct, it was being rendered as a
single list. This might be caused by the `mdx_breakless_lists` plugin
because the issue doesn't happen when the plugin isn't used (that is,
when the list actually has linebreaks above it).
2025-08-10 04:10:35 +00:00
Evan Martin
60a6e9421b cli: make diff --stat show byte counts for binary files
Fixes #6865.
2025-08-09 21:36:04 +00:00
Ilya Grigoriev
3d91d6e21b clippy: auto-fixes of clippy::implicit-clone with latest nightly 2025-08-09 03:44:26 +00:00
Emily
5aa7b4cf7e tests: compute the schema defaults in Rust rather than using jq(1)
This is a simple computation over the JSON structure of the schema,
so it doesn’t need pulling in another programming language and a
dependency on an external C program to interpret it.
2025-08-08 16:19:30 +00:00
Emily
311299bab5 tests: use jsonschema directly instead of taplo(1)
This removes an external tool dependency, skips the complexities
of subprocessing, and avoids having to poke a hole in the macOS
Nix sandbox because of `reqwest` trying to read the system’s TLS
configuration.

Note that despite the `Cargo.lock` getting bigger, this is actually a
net reduction of dependencies, as Taplo is written in Rust and pulls
in not only `jsonschema` but much more besides.
2025-08-08 16:19:30 +00:00
Ivan Petkov
dc5056ac91 cli: git clone: support --fetch-tags 2025-08-08 15:44:22 +00:00
Ivan Petkov
144e2c9c63 cli: git remote add: support --fetch-tags 2025-08-08 15:44:22 +00:00
Ivan Petkov
bf974d6911 git: support specifying tag fetch behavior when adding a remote 2025-08-08 15:44:22 +00:00
Ivan Petkov
c3574f99f1 lib/git: treat tagOpt as a standard option
In a future commit we'll add support for controlling a git remote's tag
fetch behavior, which may result in a `tagOpt = --[no-]tags` entry in
the remote configuration.

Doing this change here means we will avoid incorrectly flagging remote
configurations as unsupported.
2025-08-08 15:44:22 +00:00
Austin Seipp
afb1c1446d git: add git.colocate to colocate repos by default
Most users colocate all of their repositories or none of them. A config
option is more convenient in that situation.

There are also plans to make colocated repos the default. This change
paves the way to flip the default easily.

Closes #2507.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-08-08 07:08:46 +00:00
Yuya Nishihara
e9716761d1 cargo: bump zerovec because previous version is yanked
warning: package `zerovec v0.11.3` in Cargo.lock is yanked in registry
`crates-io`, consider running without --locked
2025-08-08 01:32:25 +00:00
Ivan Petkov
27501ee6dd nix: add numpy to the devshell
For some reason using uv's managed version of numpy fails to import.
Adding it as a flake input seems to fix things.
2025-08-07 15:13:21 +00:00
Ivan Petkov
fa649051bb docs: add a note about rustfmt configuration for Nix/direnv users
The flake/devShell is already configured to pull in a nightly version of
`rustfmt` which means running `rustfmt +nightly` will actually fail
(since we aren't pulling in `rustup`).
2025-08-07 15:13:21 +00:00
Yuya Nishihara
8435ebaa9c cli: file show: add templating support
The primary use case is to insert header/separator when printing multiple file
entries.

"jj file show" accepts the same template argument as "jj file list", and file
content is not included in the template. This is basically the same as the
relation between "jj show" and "jj log".

Closes #7181
2025-08-07 14:52:02 +00:00
Yuya Nishihara
36134a5f96 index: ensure that bit set panics on integer underflow
We'll get out-of-bounds read error later, but the panic message would be a bit
difficult to reason about.
2025-08-07 14:46:08 +00:00
Yuya Nishihara
331bd4e859 revset_graph: fix out-of-bounds bit set lookup in remove_transitive_edges()
The problem was spotted by Martin. Since we've made remove_transitive_edges()
omit "missing" edges from the set of nodes to visit at ad7c42e04b
"revset_graph: ignore missing edges thoroughly in remove_transitive_edges()", we
should also skip them in the input set.

This patch updates all test cases to run at bit-set boundary to detect other
potential issues.
2025-08-07 14:46:08 +00:00
Clément
7efb529add rebase: improve error messages when rebasing a change onto itself
The `-r` flag triggered a warning different from the `-s` one, while
being more explicit ("Cannot rebase 0000000 onto descendant 0000000" ->
"Cannot rebase 0000000 onto itself")
2025-08-07 08:37:31 +00:00
Yuya Nishihara
1edcd79af7 index: add data structure for changed-path index
This patch implements data format, serialization, and deserialization. Actual
indexing functions and disk I/O will be added later.

The data format is simple. It's basically a sorted table of paths + pointers to
the table entries per commit. Git employs Bloom filter for this purpose, but I
don't think we need a probabilistic data structure. The size of the serialized
index segments isn't big compared to the commit index segments, and the lookup
performance seems good. It's also important that we don't need to merge parent
trees when a path matches the indexed changed paths.

With git repo (77410 commits):
- changed-path segment file size: ~1.1MB
- jj log --ignore-working-copy README.md: ~0.2sec wall

Indexing takes minutes. That's not surprising because we have to merge parent
trees to get diffs.

#4674
2025-08-07 02:04:23 +00:00
Austin Seipp
44de571887 release: 0.32.0
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-08-06 16:36:14 +00:00
Isaac Corbrey
348e51f008 github: Enforce commit subject line format 2025-08-06 15:45:14 +00:00
Martin von Zweigbergk
c4fefdb03f cli: add debug commands for printing commits, operations, etc.
This should be useful when debugging people's repos. For example, I've
sometimes wondered how many sides the top-level tree conflict has.

I made the new command support operations and views too, mostly for
consistency. That makes `jj debug operation` quite redundant. However,
that command is a bit higher-level and may still be useful. I don't
see much reason to delete it.
2025-08-06 15:02:23 +00:00
Nigthknight
ad5a4b3172 copy-tracking: fix path tracking for nested directories with equal names
The problem was that the calculation of the suffix was overlapping into
the the prefix for nested directories with the same name. We skipped the
prefix to avoid this issue.

Issue: #6853

Co-authored-by: Tobias Markus <tobias@miglix.eu>
2025-08-06 06:14:57 +00:00
George Elliott-Hunter
35a0bd330a docs: Fix 7176, document colocating a repo in Windows 2025-08-06 04:49:38 +00:00
Martin von Zweigbergk
3a7ce87f44 rewrite: make duplicate_commits() async 2025-08-06 03:12:05 +00:00
Martin von Zweigbergk
073a1dea74 rewrite: make CommitRewriter::rebase() async 2025-08-06 03:12:05 +00:00