Commit graph

9789 commits

Author SHA1 Message Date
Ilya Grigoriev
b2059856bc squash: document use of -A/-B/-d with --from and not -r
For me, the trickiest part of figuring out how to use the new options
was to realize that I should assume `--from @` when using them, and
that I should not think of `-r` at all.

We still need more docs, but I think this would be a helpful
pointer for experienced users wanting to experiment with this.
2025-08-29 01:27:11 +00:00
Ilya Grigoriev
af12944dd1 squash: mark -A/-B/-d options as experimental
Follows up on 1e58ca2253

https://github.com/jj-vcs/jj/pull/7162 introduced some interesting and
useful functionality, but I feel like we should not commit to the exact
UI it sets up. The current UI is great for experimenting with this
functionality, and I don't have an immediate idea for what exactly would
be better. I'm hoping that with time and some experience
using it, we'll come up with something. See
https://github.com/jj-vcs/jj/pull/7162#issuecomment-3212555183 for more
details on this thought.

The main goal is to point new users of `squash` to the old UI, both
because I think it's currently more intuitive for new people, and also
so that they don't feel like obligated to learn the new UI, and so that
they don't get paralyzed by choice.

Another, more minor, reason to mark this as "experimental" is that it's
currently under-documented.

Since the situation is a bit confusing, and following Martin's
suggestion, I also removed these from the changelog for now.
2025-08-29 01:27:11 +00:00
Martin von Zweigbergk
00b20e24fe cli: use same per-commit labels for node and non-node templates
The top-level `immutable` and `conflict` labels we add to commits in
the node templates are also useful in the text part. For example, we
may want to color change ids for immutable commits differently (we do
that at Google). I also added a `mutable` label, to make it easier to
define colors for mutable commits without having to define the color
for all commits and then overriding it for immutable commits.
2025-08-28 16:52:09 +00:00
Martin von Zweigbergk
439536c47a cli: rename node conflict labels to node conflicted
I didn't bother with a deprecation process because the impact is so
small. Users who have customized the color can simply update their
configs. They can even keep both configs if they want to be able to
use old and new jj versions.
2025-08-28 16:52:09 +00:00
ase
3d8348f52d docs: link to type of self in template helptext 2025-08-28 10:27:11 +00:00
Martin von Zweigbergk
f058cb2937 cli: move Command::Evolog to right place in order in run_command() 2025-08-27 17:34:37 +00:00
Yuya Nishihara
0fbc2d1717 cli: remove "debug operation"/"view" command in favor of "debug object"
There aren't many callers in tests. For scripting use case, `jj op log -Tid
--no-graph -n1` or `jj op show -Tid --no-op-diff` should work.
2025-08-27 01:02:40 +00:00
Yuya Nishihara
a886ff2aec tests: migrate to new "debug object" command 2025-08-27 01:02:40 +00:00
Yuya Nishihara
27ef6359bc working_copy: load checkout state eagerly to fix error propagation
The checkout state should be small, so loading cost wouldn't matter much
compared to the tree state.
2025-08-27 00:58:24 +00:00
Yuya Nishihara
a2a5ccf772 working_copy: propagate I/O-related errors 2025-08-27 00:58:24 +00:00
Yuya Nishihara
2d8ca26f15 working_copy: leverage CheckoutState::save() to create initial state file
With this patch, init() would no longer panic when the checkout state already
existed. This should be okay because the caller always create new workspace
directory.
2025-08-27 00:58:24 +00:00
Yuya Nishihara
77e37b7e3f templater: map stringify() of unset RefSymbol value to empty string
Since other Option<T> types are stringified through Template for Option<T>, it
was inconsistent that None of RefSymbol type couldn't be stringified.
2025-08-27 00:58:19 +00:00
Christian Hufnagel
75f8a0e730 cli touch: add flag for changing author date 2025-08-26 19:02:31 +00:00
Christian Hufnagel
047b92c544 tests: move new change ID testing to a separate test as it is quite dependent on previous tests 2025-08-26 19:02:31 +00:00
Christian Hufnagel
b3b96b9bc6 tests: show timestamps in touch command tests 2025-08-26 19:02:31 +00:00
dependabot[bot]
e542b94fc6 github: bump the github-dependencies group with 5 updates
Bumps the github-dependencies group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [dtolnay/rust-toolchain](https://github.com/dtolnay/rust-toolchain) | `b3b07ba8b418998c39fb20f53e8b695cdcc8de1b` | `e97e2d8cc328f1b50210efc529dca0028893a2d9` |
| [taiki-e/install-action](https://github.com/taiki-e/install-action) | `2.58.9` | `2.58.21` |
| [EmbarkStudios/cargo-deny-action](https://github.com/embarkstudios/cargo-deny-action) | `2.0.12` | `2.0.13` |
| [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) | `6.4.3` | `6.6.0` |
| [github/codeql-action](https://github.com/github/codeql-action) | `3.29.8` | `3.29.11` |


Updates `dtolnay/rust-toolchain` from b3b07ba8b418998c39fb20f53e8b695cdcc8de1b to e97e2d8cc328f1b50210efc529dca0028893a2d9
- [Release notes](https://github.com/dtolnay/rust-toolchain/releases)
- [Commits](b3b07ba8b4...e97e2d8cc3)

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

Updates `EmbarkStudios/cargo-deny-action` from 2.0.12 to 2.0.13
- [Release notes](https://github.com/embarkstudios/cargo-deny-action/releases)
- [Commits](30f817c6f7...f2ba7abc2a)

Updates `astral-sh/setup-uv` from 6.4.3 to 6.6.0
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](e92bafb625...4959332f0f)

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

---
updated-dependencies:
- dependency-name: dtolnay/rust-toolchain
  dependency-version: e97e2d8cc328f1b50210efc529dca0028893a2d9
  dependency-type: direct:production
  dependency-group: github-dependencies
- dependency-name: taiki-e/install-action
  dependency-version: 2.58.21
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
- dependency-name: EmbarkStudios/cargo-deny-action
  dependency-version: 2.0.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
- dependency-name: astral-sh/setup-uv
  dependency-version: 6.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-dependencies
- dependency-name: github/codeql-action
  dependency-version: 3.29.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-26 14:49:16 +00:00
Remo Senekowitsch
b605639c49 cli: add redo command
This is the natural counterpart of `jj undo`. Adding `jj redo` closes
the last gap in functionality to the "undo" features of typical GUI
applications. This is much more intuitive to new users and useful than
the previous undo semantics. (Which are preserved as `jj op revert`.)

Related feature request "jj undo ergonomics":
https://github.com/jj-vcs/jj/issues/3700
2025-08-26 13:50:38 +00:00
dependabot[bot]
5911efc98e cargo: bump the cargo-dependencies group with 7 updates
Bumps the cargo-dependencies group with 7 updates:

| Package | From | To |
| --- | --- | --- |
| [async-trait](https://github.com/dtolnay/async-trait) | `0.1.88` | `0.1.89` |
| [indexmap](https://github.com/indexmap-rs/indexmap) | `2.10.0` | `2.11.0` |
| [regex](https://github.com/rust-lang/regex) | `1.11.1` | `1.11.2` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.142` | `1.0.143` |
| [tempfile](https://github.com/Stebalien/tempfile) | `3.20.0` | `3.21.0` |
| [thiserror](https://github.com/dtolnay/thiserror) | `2.0.14` | `2.0.16` |
| [toml_edit](https://github.com/toml-rs/toml) | `0.23.3` | `0.23.4` |


Updates `async-trait` from 0.1.88 to 0.1.89
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.88...0.1.89)

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

Updates `regex` from 1.11.1 to 1.11.2
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.11.1...1.11.2)

Updates `serde_json` from 1.0.142 to 1.0.143
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.142...v1.0.143)

Updates `tempfile` from 3.20.0 to 3.21.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/commits)

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

Updates `toml_edit` from 0.23.3 to 0.23.4
- [Commits](https://github.com/toml-rs/toml/compare/v0.23.3...v0.23.4)

---
updated-dependencies:
- dependency-name: async-trait
  dependency-version: 0.1.89
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: indexmap
  dependency-version: 2.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
- dependency-name: regex
  dependency-version: 1.11.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: serde_json
  dependency-version: 1.0.143
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: tempfile
  dependency-version: 3.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
- dependency-name: thiserror
  dependency-version: 2.0.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: toml_edit
  dependency-version: 0.23.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-26 08:07:24 +00:00
Yuya Nishihara
939b093fd6 cli: include diff of commit descriptions in inter-diff
I sometimes want to see how commit description is evolved.

This patch adds a separate loop for diff of commit descriptions. This should be
okay since DiffRenderer wouldn't have more than one "long" formats.
Alternatively, we could add a fake TreeDiff entry so the commit description
would be represented as a file in all diff formats. I have no idea which would
provide better UX, so I chose the simpler one.

Closes #7202
2025-08-26 00:45:08 +00:00
Yuya Nishihara
b384097caa tests: do not use "jj undo" to run multiple tests with the same setup
Since "undo" is now a high-level command, we shouldn't rely on "undo" to roll
back to a certain state.
2025-08-26 00:27:29 +00:00
Yuya Nishihara
827a87f05b tests: insert explicit snapshot after setting up test workspace
This helps capture the operation id of the snapshot.
2025-08-26 00:27:29 +00:00
Yuya Nishihara
35995514c8 tests: get current operation id without running jj
It's nice that the operation id can be captured without incrementing seed.
2025-08-26 00:27:29 +00:00
Ian Wrzesinski
9d67c47a0c working_copy: Break out CheckoutState load and save functions 2025-08-25 22:40:48 +00:00
Ivan Petkov
75fa7de001 cli: git fetch: fall back to remote fetch refspecs when -b not specified
This changes the behavior of git fetch to respect the fetch refspecs
configured on the remote. This is handy for projects which use
customized fetch refspecs (e.g. only fetch certain patterns, but not all
branches) but without having to remember and repeat all the patterns by
hand on the CLI

Fixes #5323
2025-08-25 15:55:18 +00:00
Ivan Petkov
4563621f89 cli: inline do_git_fetch 2025-08-25 15:55:18 +00:00
Ivan Petkov
72fde508c6 lib: support negative refspecs on git remotes 2025-08-25 15:55:18 +00:00
Ivan Petkov
98ce815699 lib: add representation for a negative git refspec 2025-08-25 15:55:18 +00:00
Ivan Petkov
27d4c80c50 lib: require caller to provide an expanded list of refspecs to fetch 2025-08-25 15:55:18 +00:00
Ivan Petkov
e0ca7c653d lib: refactor git fetch ahead of future updates 2025-08-25 15:55:18 +00:00
Ian Wrzesinski
5f8dd79e8b working_copy: Move TreeState struct definition closer to impl block 2025-08-25 07:01:09 +00:00
Yuya Nishihara
a763de49ed templater: add serialization support for config::AnnotatedValue type
GenericTemplateLanguage now requires C: Serialize, which I think is okay because
the context type here would usually be a struct of value types.
2025-08-25 05:52:46 +00:00
Yuya Nishihara
535d8d48dd templater: serialize ConfigValue through toml::Value
We could instead implement serde::Serialize wrapper manually, but it would be
tedious to process recursive data structure. Let's just rely on the toml crate.
The cost of conversion wouldn't matter.
2025-08-25 05:52:46 +00:00
Yuya Nishihara
4962e13480 templater: relax trait bounds of methods table types
Instead of requiring L::Property type, make it the default type parameter which
can be specified as needed. This helps remove unnecessary trait bounds from
later patches.
2025-08-25 05:52:46 +00:00
Yuya Nishihara
bbf12c5ab5 templater: reorder generic functions in methods table, rename variables
This isn't important, but empty() and merge() don't need L: TemplateLanguage, so
they can be split to new impl block.
2025-08-25 05:52:46 +00:00
Yuya Nishihara
6e63c5d9aa templates: remove operation timestamp from default evolog template
The operation timestamp is often very close to the committer timestamp, so I
don't think it's useful in evolog. I also removed "root()" as it wouldn't be
useful either, and the root operation should have no evolved commits.
2025-08-25 05:52:37 +00:00
Martin von Zweigbergk
70477bcb2a docs: remove trailing whitespace
Some internal checks at Google reported this.
2025-08-25 00:05:21 +00:00
Ian Wrzesinski
ab8bf205a5 diff_working_copies: Simplify tree checkout functions
I got annoyed by the checkout function and tried to compress the code a bit,
and I think the result is much nicer. I'm not certain that a closure is the
right solution here, but I think it becomes easier to reason about the two
temp filenames that get generated.

I initially changed `Option<DiffSide>` to a bool, but found an enum more
meaningful and more likely to be flexible in the future.

I also moved the instruction writing to its own function. This makes the main
`DiffEditWorkingCopies::check_out()` function much nicer.
2025-08-24 22:55:37 +00:00
Remo Senekowitsch
32020573b8 undo: deprecate the --what flag
Relevant discussion:
https://github.com/jj-vcs/jj/pull/7277#discussion_r2291421321
2025-08-24 07:14:01 +00:00
Remo Senekowitsch
12b3a26f3d undo: revert progressively older operations with repeated calls
New users (especially ones unfamiliar with CLI programs) intuitively
expect `jj undo` to work the same way the "undo" functionality of
typical GUI applications do. That means, running `jj undo` multiple
times should restore progressively older states of the repository
one-by-one.

Related feature request "jj undo ergonomics":
https://github.com/jj-vcs/jj/issues/3700
2025-08-24 06:56:40 +00:00
Remo Senekowitsch
2a6a7149d5 changelog: trim trailing whitespace 2025-08-24 06:56:40 +00:00
Ivan Petkov
61a5c10916 cli: use clap::ValueHint::{FilePath,DirPath} over PathCompleter::{file,dir}()
The only two cases where PathCompleter was used were simple enough to be
replaced with clap::ValueHint directly (since statically know the type
of file to be completed). This also makes things more consistent given
that we use clap::ValueHint everywhere else.

The main difference between PathCompleter and ValueHint is that
PathCompleter requires dynamic completion, wheres ValueHint works in
static situations.
2025-08-24 03:13:45 +00:00
Ivan Petkov
09251f158a cli: complete destination paths for jj workspace add 2025-08-23 22:18:14 +00:00
Graham Christensen
1b150d12bd test: use a fifo in test_local_working_copy to avoid too-long unix domain sockets on macOS 2025-08-23 13:48:25 +00:00
Graham Christensen
ec53ac6c55 github: restore building for macOS in Nix
This reverts commit 4558797e81.
2025-08-23 13:48:25 +00:00
Graham Christensen
297c434c93 ci: Skip the GPG tests if they cannot pass on macOS 2025-08-23 13:48:25 +00:00
Yuya Nishihara
1b33da4df2 config: remove workaround for implicit inline table insertion
This reverts commit 31d12c9245. The problem should
be fixed by upstream:

> Implicitly treat Tables inside of a Value as an InlineTable, rather than
> skipping them
https://github.com/toml-rs/toml/blob/main/crates/toml_edit/CHANGELOG.md#0230---2025-07-08
2025-08-23 03:46:11 +00:00
Yuya Nishihara
7e80eb4dfa cargo: bump toml_edit to 0.23.3
Also updated deprecated ImDocument references to Document.
2025-08-23 03:46:11 +00:00
Nikhil Marathe
d2655f449d docs: Add a section for Selvejj
Selvejj is a plugin for JetBrains IDEs to support jj.
2025-08-22 14:31:08 +00:00
Yuya Nishihara
0367c96037 templates: simplify blank line insertion in default draft commit description
Since there exists at least one "JJ:" line, we no longer need to insert blank
line conditionally.
2025-08-22 04:53:02 +00:00
Yuya Nishihara
cd673311d0 index: remove forwarding function of CompositeIndex::evaluate_revset()
Since Index is now implemented for CompositeIndex instead of &CompositeIndex,
these two functions have exactly the same signature. We no longer need a
specialized implementation to correct lifetime of the return value.
2025-08-22 00:29:32 +00:00