Commit graph

10445 commits

Author SHA1 Message Date
Yuya Nishihara
402bbeae6d cargo: bump gix to v0.76.0
Some checks failed
binaries / Build binary artifacts (push) Has been cancelled
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CommitRef now stores raw author/committer headers and parses them when needed.
Since parsing errors would have been detected at .try_to_commit_ref(), this
patch makes new decode errors propagate as before.

Fixes #8350, #8214
2025-12-23 05:31:49 +00:00
Scott Taylor
34a1f86862 merge: include conflict labels when describing non-file conflicts
This should make it easier to resolve these conflicts using
`jj restore --from <commit>`.
2025-12-23 04:11:09 +00:00
Ilya Grigoriev
b2792e190b cli config list docs: explain config key format in templates
This also means that this field should not become a `List<String>`,
though it would make sense to create a new type for it (which could be
converted into `List<String>` in two different ways, with or without
quoting).
2025-12-23 03:27:58 +00:00
dependabot[bot]
513c5f7b3c 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.63.3 to 2.65.1
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](d850aa8169...b9c5db3aef)

Updates `github/codeql-action` from 4.31.8 to 4.31.9
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](1b168cd394...5d4e8d1aca)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-23 02:41:07 +00:00
Scott Taylor
5fd1b2fd5b rewrite: add conflict labels for squashed commits
An example of squashing `ysrnknol` into `rtsqusxu`:

```
<<<<<<< conflict 1 of 1
+++++++ rtsqusxu 2768b0b9 "A" (squash destination)
updated in destination
%%%%%%% diff from: vpxusssl 38d49363 "B" (parents of squashed commit)
\\\\\\\        to: ysrnknol 7a20f389 "C" (squashed commit)
-base
+squashed
>>>>>>> conflict 1 of 1 ends
```

Or with only partial changes selected:

```
<<<<<<< conflict 1 of 1
+++++++ rtsqusxu 2768b0b9 "A" (squash destination)
updated in destination
%%%%%%% diff from: vpxusssl 38d49363 "B" (parents of squashed commit)
\\\\\\\        to: selected changes for squash (from ysrnknol 7a20f389 "C")
-base
+selected changes
>>>>>>> conflict 1 of 1 ends
```
2025-12-23 00:59:32 +00:00
Scott Taylor
225bbe4835 rewrite: add conflict label methods for CommitWithSelection 2025-12-23 00:59:32 +00:00
Scott Taylor
5c7d0b0f55 merge: add Diff::invert method 2025-12-23 00:59:32 +00:00
Scott Taylor
4adbdd9d76 merge: add Merge::from_diffs constructor 2025-12-23 00:59:32 +00:00
Scott Taylor
1e521f564d merged_tree: migrate more callers to MergedTree::conflicts_matching
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
2025-12-22 14:58:57 +00:00
Vincent Ging Ho Yim
e9b280148e cli commit: wrap each flag in backticks in doc comment
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
2025-12-22 08:30:56 +00:00
David Higgs
223470295e cli: remove newline addition between template and content
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Commands `jj log`, `jj evolog`, and `jj op log` automatically added a
terminating newline when the expanded template did not include one in graph
mode. No-graph mode did not do this, so the expanded template could combine with
any following content (diff, op changes, etc) in confusing or problematic ways.

Instead of trying to compensate in all cases, remove the auto-fixups. Users
should confirm their custom templates still expand correctly for their needs.
2025-12-22 02:47:58 +00:00
Scott Taylor
d8e51087a2 cli_util: use change offset in conflict hint when necessary
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Resolves #8330.
2025-12-21 14:44:31 +00:00
Yuya Nishihara
3fad6ead29 tests: set up local TMPDIR which should be cleaned up by test runner
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Otherwise a few editor-*.jjdescription files would be left in /tmp.
2025-12-21 01:54:31 +00:00
Scott Taylor
bc4ed3eef1 demos: re-generate demo images 2025-12-20 23:12:48 +00:00
Scott Taylor
3ac3685876 demos: update demo scripts with recent changes
Since the last update, `-d` has been renamed to `-o/--onto`, the
local backend has been renamed to the simple backend, and colocation is
enabled by default.
2025-12-20 23:12:48 +00:00
Scott Taylor
2ce2a445b0 conflicts: show "noeol" state separately for each side of a diff
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Now that we can put the "from" and "to" sides on separate lines, we can
use the normal "(no terminating newline)" comment on each side
separately. This should also be more clear, since previously the
"(no terminating newline)" comment could possibly be confused for
"(removes terminating newline)".

Before:

```
<<<<<<< conflict 1 of 1
+++++++ rtsqusxu 2768b0b9 "commit A" (no terminating newline)
grapefruit
%%%%%%% diff from: vpxusssl 38d49363 "merge base"
\\\\\\\        to: ysrnknol 7a20f389 "commit B" (adds terminating newline)
-grape
+grape
>>>>>>> conflict 1 of 1 ends
```

After:

```
<<<<<<< conflict 1 of 1
+++++++ rtsqusxu 2768b0b9 "commit A" (no terminating newline)
grapefruit
%%%%%%% diff from: vpxusssl 38d49363 "merge base" (no terminating newline)
\\\\\\\        to: ysrnknol 7a20f389 "commit B"
-grape
+grape
>>>>>>> conflict 1 of 1 ends
```
2025-12-20 17:43:41 +00:00
Scott Taylor
33ad38bfed templates: add "divergent" label to log for divergent changes
It would be good to include the word "divergent" in the log when a
change is divergent, since users are often unsure what's happening when
they see a divergent change, and giving them a term to search for would
be helpful. However, I don't think it looks good to put this label next
to the change ID itself if both are the same color, since it ends up
being hard to distinguish from the change offset at a glance. Also,
putting the label next to the change ID also messes up the alignment of
fields in the log. Therefore, I think it looks better to put the
"divergent" label at the end of the line.

Since divergence and hidden commits are similar, it makes sense for both
labels to be in the same place, so I also moved the hidden label to the
end for consistency.

One downside is that the labels are less obviously connected with the
change ID itself due to them being farther apart. I think this could be
fine, since they are still visually connected by being the same color.
2025-12-20 16:55:51 +00:00
Scott Taylor
144ba766b1 rewrite: add conflict labels for rebased commits
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
An example of rebasing `ysrnknol` onto `rtsqusxu`:

```
<<<<<<< conflict 1 of 1
%%%%%%% diff from: vpxusssl 38d49363 "base" (parents of rebased commit)
\\\\\\\        to: rtsqusxu 2768b0b9 "left" (rebase destination)
-base
+left
+++++++ ysrnknol 7a20f389 "right" (rebased commit)
right
>>>>>>> conflict 1 of 1 ends
```
2025-12-20 04:03:57 +00:00
Scott Taylor
04a91217f5 rewrite: add conflict labels when merging commit trees
An example with parents `rtsqusxu` and `ysrnknol`:

```
<<<<<<< conflict 1 of 1
%%%%%%% diff from: vpxusssl 38d49363 "description of base"
\\\\\\\        to: rtsqusxu 2768b0b9 "description of left"
-base
+left
+++++++ ysrnknol 7a20f389 "description of right"
right
>>>>>>> conflict 1 of 1 ends
```
2025-12-20 04:03:57 +00:00
Scott Taylor
242e2f8ccb conflicts: materialize conflict labels if present
Since conflict labels are generally going to be long, this introduces a
new "note" conflict marker (`\\\\\\\`), which can be used to split the
"diff" conflict marker (`%%%%%%%`) across two lines:

```
<<<<<<< conflict 1 of 1
%%%%%%% diff from: vpxusssl 38d49363 "description of base"
\\\\\\\        to: rtsqusxu 2768b0b9 "description of left"
-base
+left
+++++++ ysrnknol 7a20f389 "description of right"
right
>>>>>>> conflict 1 of 1 ends
```
2025-12-20 04:03:57 +00:00
Scott Taylor
ba73442b2a conflicts: update conflict marker format
Conflict labels will generally start with lowercase change IDs, so
making all of the text lowercase makes it more consistent. I also
removed the "contents of" text, since conflict labels will already be
long enough, and this text doesn't add anything. Similarly, I removed
the "(conflict 1 of 1)" note from the Git conflict markers since Git
doesn't include this information, and including it would result in extra
long lines once we add conflict labels.
2025-12-20 04:03:57 +00:00
Steve Klabnik
5dd63d691e docs: improve interdiff command documentation
Rewrite the `interdiff` help text to be clearer about what the command does.

Closes #7033
2025-12-20 00:03:02 +00:00
Steve Klabnik
e00d154c92 cli: document -r as alias for positional revision arguments
Several commands accept both positional arguments and a `-r` flag for
specifying revisions. The `-r` flag exists for consistency with other
commands, but was previously hidden from help output.

Instead of unhiding `-r` (which would clutter the Options section),
document the aliasing by adding `[aliases: -r]` to the positional
argument's help text. This makes the relationship discoverable while
keeping the help output clean.

Commands updated: abandon, describe, duplicate, edit, metaedit, new, show

Fixes #8104
2025-12-19 22:29:01 +00:00
Steve Klabnik
a59c2d2efe docs: elaborate on jj git push behavior
Add more detail about both the range of commits that will be pushed, as well as
it being a --force-with-lease.

Fixes #3672
2025-12-19 22:01:42 +00:00
Steve Klabnik
ba0e9a4946 docs: clarify behavior of selected vs remaining changes
The help text for `jj split` was confusing about what happens to
"selected" vs "remaining" changes, especially with the `-o/-A/-B` flags.

This change:
- Adds ASCII diagrams showing the commit graph transformations for
  default split, --parallel, and -o/-A/-B modes
- Clarifies that by default, selected changes stay in the original
  commit while remaining changes go to a new child
- Explains that with -o/-A/-B, selected changes are extracted to a
  new commit at the destination while remaining changes stay in place
- Improves the --message flag description to clarify it applies to
  the first commit (containing selected changes)
- Adds explanatory text to the -o, -A, and -B flag descriptions
2025-12-19 20:22:57 +00:00
Steve Klabnik
97c03ea8a3 docs: clarify that some template parameters require literal strings
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Rename parameter type `String` to `StringLiteral` where methods require
a literal string known at parse time rather than a dynamic expression.
This makes the documentation faithful to the underlying code, which uses
`expect_string_literal()` and reports "Expected string literal" errors.

Add a new `StringLiteral` type section explaining the distinction.

Fixes #7068
2025-12-19 19:57:54 +00:00
Yuya Nishihara
5e22ae6bd9 cli: new: parse -r/-o option properly, merge with positional arguments
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Because the order of parents matters, we have to merge positional and -o
arguments in order of appearance.
2025-12-19 09:39:53 +00:00
Yuya Nishihara
be34efe22b cli: show: parse -r option properly
The default can no longer be set by clap because there may be "-r" argument.
2025-12-19 09:39:53 +00:00
Yuya Nishihara
e461f2401a cli: edit: parse -r option properly
This one is easy since there should be exactly one REVSET argument.
2025-12-19 09:39:53 +00:00
Martin von Zweigbergk
980ac17d36 bisect: add missing closing backtick, make tests pass on Windows
This removes the dependencies on `true`, `false`, and `test`
executables, which are often not available on Windows.
2025-12-19 04:18:46 +00:00
Martin von Zweigbergk
a9fc4e8905 cli: add a very basic jj file search (like git grep)
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
This is lacking a lot but should be good as a starting point.
2025-12-18 06:31:37 +00:00
Martin von Zweigbergk
3767857a45 revset_engine: move match_lines() onto StringPattern for reuse 2025-12-18 06:31:37 +00:00
Yuya Nishihara
412326eebb repo_path: use stringified paths when formatting copied path
Since String provides more convenient functions for searching/splitting than
OsString, it should be simpler to convert relative PathBuf to String first. The
tricky part is "right-to-left" version of .split_inclusive("/"), but the
original code wasn't readable either.

"if !paths.is_changed()" is removed since the formatting function can now handle
unchanged paths.
2025-12-18 06:28:01 +00:00
Yuya Nishihara
79cefebb68 repo_path: use Diff<T> to specify copied source/target paths
copied_path.to_diff() returns Option<Diff<T>> because it seemed silly to compare
before/after paths when the caller knows the entry isn't copied/renamed.
2025-12-18 06:28:01 +00:00
Yuya Nishihara
ad5ae40b04 cli: gerrit: remove excessive newlines and "warning:" prefix, respect --quiet
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
It seemed weird that the test snapshots had random blank lines.
2025-12-18 00:13:25 +00:00
Yuya Nishihara
f059bc4017 cli: gerrit: avoid loading parent commit objects needlessly 2025-12-18 00:13:25 +00:00
Thomas Castiglione
66d04235c6 watchman: don't start a new tokio runtime if there already is one
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
LockedWorkingCopy::snapshot() is already async, so this is just a matter of changing TreeState::snapshot() and making the runtime conditional
2025-12-17 17:31:07 +00:00
Yuya Nishihara
3f6c2c1e2e stacked_table: add gc() function to prune unreachable table segments
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
This is an easy part of Git extra table GC. The implementation is quite similar
to SimpleOpStore::gc(). Since we don't delete unreachable "commit" entries from
the table segments, this wouldn't improve runtime performance. Directory lookup
might get slightly faster thanks to fewer file entries, though.

#12, #8312
2025-12-17 10:38:11 +00:00
Yuya Nishihara
e0a725736d cli: add debug command that dumps stats of stacked table
This is pretty low level, but we can at least know which extras table files are
active. The --key-size parameter doesn't matter so long as it is smaller than
the actual key size, but we might add sanity check later.
2025-12-17 10:38:11 +00:00
Scott Taylor
dc325cbdb2 complete: include offset in completions for divergent changes
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
2025-12-17 02:12:55 +00:00
Jonathan Hoelzel
537dbc04ea docs: Add myself as paid contributor (under IMC Trading)
The prior commit in this PR was done of my own accord but during work
hours, so adding myself to this list.
2025-12-17 00:30:17 +00:00
Jonathan Hoelzel
69477cd465 gerrit: handle mixed explicit & implicit Change-Ids in upload
The 'gerrit upload' cli command is meant to support uploading commits
that have an explicit "Change-Id: ..." footer, and those that don't. In
the latter case, a temporary copy of the commit being uploaded will be
created, with the Change-Id set based on the jj change id.

Prior to this commit, there was a bug in this implementation when a
chain of commits contained some with Change-Id footers and some without.

Say we have commits a->b->c, where b has no Change-Id footer but c does
(this case is what's now tested in the test_gerrit_upload_local case).

The old logic would:
- create a new version of b (let's call it b*), with a CommitId footer,
  and populate the 'old_to_new' map with 'b -> b*'
- not create a new version of c, and populate the 'old_to_new' map with
  'c -> c'
- push the 'new' version of c, which is c itself. However, c has b as a
  parent, not b*, so this fails to send to gerrit because b has no
  Commit-Id footer!

After this commit, we create a new temporary commit if either the
description is changed (as before), or if any parents are different from
the original commit's parents. This does not change the behavior for
either the all-explicit or all-implicit ChangeId cases, but fixes the
behavior in this mixed case.
2025-12-17 00:30:17 +00:00
Jonathan Hoelzel
ea5f23d3ce gerrit: add test for all-explicit change-ids for upload command
The 'gerrit upload' command has logic to handle commits with the
"Change-Id" explicitly set within the commit message, and commits
without the Change-Id explicitly set. This commit adds a test for the
behavior when all commits have the Change-Id explicitly set.

Also fix typo in existing test comment
2025-12-17 00:30:17 +00:00
Steve Klabnik
ead7a16427 docs: remove non-functional xonsh completion instructions
Related to #8141
2025-12-16 22:02:02 +00:00
dependabot[bot]
e4841aca9b github: bump the github-dependencies group with 5 updates
Bumps the github-dependencies group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `5.0.0` | `6.0.0` |
| [taiki-e/install-action](https://github.com/taiki-e/install-action) | `2.62.63` | `2.63.3` |
| [cachix/install-nix-action](https://github.com/cachix/install-nix-action) | `31.8.4` | `31.9.0` |
| [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) | `7.1.5` | `7.1.6` |
| [github/codeql-action](https://github.com/github/codeql-action) | `4.31.7` | `4.31.8` |


Updates `actions/upload-artifact` from 5.0.0 to 6.0.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](330a01c490...b7c566a772)

Updates `taiki-e/install-action` from 2.62.63 to 2.63.3
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](50708e9ba8...d850aa8169)

Updates `cachix/install-nix-action` from 31.8.4 to 31.9.0
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](0b0e072294...4e002c8ec8)

Updates `astral-sh/setup-uv` from 7.1.5 to 7.1.6
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](ed21f2f24f...681c641aba)

Updates `github/codeql-action` from 4.31.7 to 4.31.8
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](cf1bb45a27...1b168cd394)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 6.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.63.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-dependencies
- dependency-name: cachix/install-nix-action
  dependency-version: 31.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-dependencies
- dependency-name: astral-sh/setup-uv
  dependency-version: 7.1.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
- dependency-name: github/codeql-action
  dependency-version: 4.31.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-16 20:01:22 +00:00
Shnatu
4a3c56ef4c paid_contributors: Add kiranani (snatu@google.com) 2025-12-16 20:01:11 +00:00
Scott Taylor
40637b294a default_index: sort resolve_change_id_prefix() by descending position
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
2025-12-16 14:27:11 +00:00
Scott Taylor
1fb5a9656b command_error: use offset in hint for divergent changes
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
It's usually going to be easier for a user to run the same command again
but with a change offset appended, so I think these are more helpful
than commit IDs.
2025-12-16 02:02:31 +00:00
Scott Taylor
edc578c56b docs: update examples of divergence to include change offsets 2025-12-16 02:02:31 +00:00
Scott Taylor
0dffb6f108 templates: show change offsets for divergent and hidden commits
For now, I just replaced `??` with the change offset for divergent
commits. We can add an explicit "divergent" label later.
2025-12-16 02:02:31 +00:00