8712 Commits

Author SHA1 Message Date
Yuya Nishihara
791e04954e cli: bookmark: collect all list items to temporary vec
I think this will help implement sorting options. Untracked remote bookmarks
should be sorted independently, whereas tracked remote bookmarks should always
be listed after the associated local bookmarks.
2025-03-09 09:33:07 +00:00
Yuya Nishihara
cdcaee62f1 templater: add public getter methods to RefName type
Some of these will be called from "jj bookmark list". The template RefName type
is useful as an abstract local/remote ref object. Maybe it should be renamed to
RefEntry or CommitRef.
2025-03-09 09:33:07 +00:00
Martin von Zweigbergk
0055cd4e0b cli tests: move create_commit() tests helpers to common/ 2025-03-09 00:44:25 +00:00
Martin von Zweigbergk
169c131902 test_git_fetch: move clarification of description to template
I'm about to move the `create_commit()` helper to a common
place. However, this version of `create_commit()` is different from
the others in that it put a prefix of "descr_for_" in the
description. This patch removes that and instead updates the template
so it's still clear what's a description and what's a bookmark name.
2025-03-09 00:44:25 +00:00
Caleb White
813d2f1e6d config: update diff-editor and merge-editor schema
The docs show that the diff-editor, and merge-editor settings
can be a string or an array of strings. This updates the config
schema to reflect that.
2025-03-09 00:16:04 +00:00
Martin von Zweigbergk
95aac580b0 rewrite: fix a Clippy lint 2025-03-08 20:45:39 +00:00
Emily
596738a303 cargo: bump git2 to 0.20.0 2025-03-08 16:50:58 +00:00
Benjamin Tan
c248d97679 cli: debug copy-detection: fix help text
It looks like the help text was copied from another command and not
updated.
2025-03-08 15:28:55 +00:00
Anton Älgmyr
a209f522ab docs: Update documentation wrt JJ_CONFIG and --when/--scope
This is hidden gem of a feature, especially in combination.

`JJ_CONFIG` being a directory allows loading multiple TOML config files.
`--when` can be used on the top level, which can lend itself to a much
cleaner config than `[[--scope]]` tables.
2025-03-08 11:19:39 +00:00
Ilya Grigoriev
7b38f82b3f cli op log: short -d alias for --op-diff
`--op-diff` is often more useful than `-p`/`--patch`.
2025-03-08 06:49:34 +00:00
Yuya Nishihara
697cd504ff cli: pass clap::Error to map_clap_cli_error() 2025-03-08 04:33:09 +00:00
Yuya Nishihara
9bf2e9b20d cli: move tracing configuration out of parse_args()
This helps simplify the error type. It's also weird that the parsing function
sets up tracing subscription.
2025-03-08 04:33:09 +00:00
dependabot[bot]
3df26f2d70 github: bump the github-dependencies group across 1 directory with 2 updates
Bumps the github-dependencies group with 2 updates in the / directory: [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.15 to 2.49.16
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](955a6ff141...1426bdb9e2)

Updates `github/codeql-action` from 3.28.10 to 3.28.11
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b56ba49b26...6bb031afdd)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-08 02:12:22 +00:00
dependabot[bot]
1f38488b07 cargo: bump the cargo-dependencies group across 1 directory with 2 updates
Bumps the cargo-dependencies group with 2 updates in the / directory: [tempfile](https://github.com/Stebalien/tempfile) and [tokio](https://github.com/tokio-rs/tokio).


Updates `tempfile` from 3.17.1 to 3.18.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.17.1...v3.18.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-08 01:53:32 +00:00
Yuya Nishihara
a27d925565 cleanup: switch to use<'_> capturing syntax
This patch fixes `'a: 'b, 'a` lifetime constraints, adds use<>, use<'_>, etc.
where the default would differ between editions. Redundant '_ is also removed.

https://doc.rust-lang.org/stable/edition-guide/rust-2024/rpit-lifetime-capture.html#edition-specific-rules-when-no-use-bound-is-present
2025-03-08 01:16:56 +00:00
Yuya Nishihara
b255dbed0a cleanup: remove unneeded lifetime capturing from snapshot_progress()
ui.progress_output() doesn't borrow anything from &Ui, and there would be no
reason to extend the borrow. Write ops on Ui don't require mutable instance.
2025-03-08 01:16:56 +00:00
Yuya Nishihara
df3c15a030 revset: remove support for multiple files() arguments
Since there are no revset functions that require at least N arguments, the
error message test is moved to test_templater.rs.
2025-03-08 00:54:28 +00:00
Yuya Nishihara
d9615800ec revset: replace use of deprecated file() alias in tests 2025-03-08 00:54:28 +00:00
Yuya Nishihara
bf54158fa2 revset: remove deprecated singular aliases 2025-03-08 00:54:28 +00:00
Yuya Nishihara
54868877d6 revset, templater: remove deprecated "branches" aliases 2025-03-08 00:54:28 +00:00
Evan Mesterhazy
0edf23eb16 lib rewrite: Add a test for CommitWithSelection
This is in preparation for adding a new function that inverts the selection.
2025-03-08 00:11:29 +00:00
Evan Mesterhazy
29e2ccf4ae cargo-deny: Ignore paste crate deprecation
The paste crate hasn't had a maintainer since Oct. 2024. We don't use it
directly, but it's used by ratatui, and there's no direct replacement for it
AFAIK.

Advisory: https://rustsec.org/advisories/RUSTSEC-2024-0436

This is currently blocking PRs because ci fails:
```
error[unmaintained]: paste - no longer maintained
    ┌─ /github/workspace/Cargo.lock:262:1
    │
262 │ paste 1.0.15 registry+https://github.com/rust-lang/crates.io-index
    │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ unmaintained advisory detected
    │
    ├ ID: RUSTSEC-2024-0436
    ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2024-0436
    ├ The creator of the crate `paste` has stated in the [`README.md`](https://github.com/dtolnay/paste/blob/master/README.md) 
      that this project is not longer maintained as well as archived the repository
    ├ Announcement: https://github.com/dtolnay/paste
    ├ Solution: No safe upgrade is available!
    ├ paste v1.0.15
      └── ratatui v0.29.0
          └── scm-record v0.5.0
              └── jj-cli v0.27.0
                  └── (dev) jj-cli v0.27.0 (*)

advisories FAILED
```
2025-03-07 19:21:36 +00:00
George Christou
ad39c97d04 cli: remove untrack subcommand 2025-03-07 11:00:08 +00:00
Yuya Nishihara
dfb10cab9b git: reject reserved remote name early in fetch() function
I'm going to make git::import_refs() not fail because of a real remote named
"git", but fetching from such remote should be an error.
2025-03-07 03:03:45 +00:00
Yuya Nishihara
b2fd1a002e git: extract helper to check unsupported remote name 2025-03-07 03:03:45 +00:00
Yuya Nishihara
99bc2d2f7d git: consolidate when to check unsupported remote name on push
It's odd that "foo/bar" is tested earlier in push_branches() whereas "git" is
rejected by push_updates(). Suppose push_updates() is a low-level function to
push arbitrary refs without updating jj's repo view, it's probably okay to allow
unsupported remote name here.
2025-03-07 03:03:45 +00:00
George Christou
5eb3c5b658 cli: remove unsquash subcommand 2025-03-07 01:46:19 +00:00
Brandon Hall
e71650a27a Update community_tools.md
Added a link and blurb about the took VS Code extension Jujutsu Kaizen
2025-03-07 01:13:25 +00:00
Martin von Zweigbergk
9aeb13488c docs: correct description of tracking of ignored files 2025-03-06 22:29:05 +00:00
Ilya Grigoriev
5eae2d92a0 tests: run insta --force-update-snapshots
This is a replacement for #5558.

Thanks to @yuja 's https://github.com/mitsuhiko/insta/pull/722, this is
now easy to generate.
2025-03-06 21:35:08 +00:00
dependabot[bot]
09f7613f46 cargo: bump the cargo-dependencies group with 3 updates
Bumps the cargo-dependencies group with 3 updates: [either](https://github.com/rayon-rs/either), [indoc](https://github.com/dtolnay/indoc) and [textwrap](https://github.com/mgeisler/textwrap).


Updates `either` from 1.14.0 to 1.15.0
- [Commits](https://github.com/rayon-rs/either/compare/1.14.0...1.15.0)

Updates `indoc` from 2.0.5 to 2.0.6
- [Release notes](https://github.com/dtolnay/indoc/releases)
- [Commits](https://github.com/dtolnay/indoc/compare/2.0.5...2.0.6)

Updates `textwrap` from 0.16.1 to 0.16.2
- [Release notes](https://github.com/mgeisler/textwrap/releases)
- [Changelog](https://github.com/mgeisler/textwrap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mgeisler/textwrap/compare/0.16.1...0.16.2)

---
updated-dependencies:
- dependency-name: either
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
- dependency-name: indoc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: textwrap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-06 21:26:56 +00:00
Evan Mesterhazy
3ab5f1d197 cli split: Refactor and move tree selection to a function
This change moves the code for prompting the user to select changes for the
first commit to a helper function. There are no functional changes.

Resulting from the discussion in https://github.com/jj-vcs/jj/pull/5828
we are planning to add several new flags (-B, -A, and -d) to jj split.

Since this may change how the user selects changes (i.e. they may select
changes to remove from the target commit, rather than what stays in the target
commit), I want to move the selection logic to a function to make the main
split function more readable.
2025-03-06 14:38:29 +00:00
Evan Mesterhazy
707680be22 rewrite: Rename CommitToSquash to CommitWithSelection
Removing "Squash" from the name will allow this type to be used in split as
well without it being confusing.
2025-03-06 14:38:29 +00:00
Evan Mesterhazy
0b583ff3a7 cli split: Add a function to resolve the raw cli arguments
This is part of a refactor of cmd_split in preparation for adding new -A, -B,
and -d arguments to control where the changes split from the target commit end
up.

The goal is to simplify the flow in the main cmd_split function and manage
complexity introduced by the new options. In this case, the raw arguments will
be parsed once at the beginning of the command in resolve_args, after which the
raw SplitArgs are no longer used.

The function is pretty simple now, but will evolve once the new arguments are
added.
2025-03-06 14:38:29 +00:00
Yuya Nishihara
c6ed2afbfa tests: wrap formatter output so insta won't trim trailing whitespace
Not all tests should be strict about whitespace, but formatting tests usually
should.
2025-03-06 13:47:12 +00:00
George Christou
693be6cc02 config: remove support for git.push-branch-prefix 2025-03-06 11:47:01 +00:00
Jonathan Gilchrist
742bc8af1c config: Allow hiding the 'how to resolve conflicts' hint
This only deals with a single hint for now to resolve any discussions
around naming and approach.
2025-03-06 10:49:54 +00:00
George Christou
b7f7d923bd config: rename core.watchman.register_snapshot_trigger 2025-03-06 08:42:35 +00:00
Ilya Grigoriev
9af7e5b7ed cargo: use MSRV-aware resolver 2025-03-06 07:24:28 +00:00
Ilya Grigoriev
c36bfafb6a clippy: replace allow directives with expect or delete them when possible
Also resolves one TODO made possible by the new MSRV

Most of this was done by enabling the lint forbidding `allow` directives
using `cargo cranky`, running `cargo cranky --workspace
--all-featuers --fix`, and fixing up the result.
2025-03-06 07:24:28 +00:00
Ilya Grigoriev
1ede79c483 MSRV: Update to 1.84 and run clippy --fix, cargo fmt
The CI seems to correctly use rustc 1.84.1 (and not 1.84.0) with this.

For reference, we last updated the MSRV to 1.76 in 5b517b5. According to
https://releases.rs/docs/1.76.0/, this was when it barely became stable.

`flake.nix` seems to be using a nightly toolchain now, so it seems there
is no need to update the version there.

The more precise clippy command used was:

cargo clippy --workspace --all-targets --fix
2025-03-06 07:24:28 +00:00
dependabot[bot]
4d4ec1afc6 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.13 to 2.49.15
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](970d55e3ce...955a6ff141)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-06 02:01:54 +00:00
Ilya Grigoriev
6ce7a77da5 release: 0.27.0 v0.27.0 2025-03-05 23:48:50 +00:00
Ilya Grigoriev
2bcf0384e2 FAQ: detailed example for the "accidentally changed files in the wrong commit" question
It was requested on Discord once.

The result is almost a tutorial; we could consider actually moving it into the
tutorial and providing a link in the FAQ. That could be done separately.

The `jj` commands outputs are faked in a few, hopefully inconspicuous, ways.
Hopefully, this is not distracting.
2025-03-05 23:46:32 +00:00
Yuya Nishihara
b0e9bdffc0 settings: load signing parameters early, propagate config error
Typo in signing.behavior shouldn't be ignored.

The idea is the same as [user] and [operation] tables. It's easier if all
parameters needed to create a commit is parsed by UserSettings constructor.
Another option is to make repo.start_transaction() fail on config error.
2025-03-05 10:02:42 +00:00
Ilya Grigoriev
1449c2d040 debug init-local: remove the ui.allow-init-native option
It is not needed to gate `jj debug init-local` on an option now that the
command is no longer called `jj init`.

This also includes a separate fixup to #5845 in demos/
2025-03-05 05:52:02 +00:00
Ilya Grigoriev
5590e9473e jj debug init-local: fixup, docs
Fixups to #5845
2025-03-05 05:52:02 +00:00
Baltasar Dinis
4c5800ac4a cli/tests: port test_git_clone to gitoxide 2025-03-05 05:39:19 +00:00
Baltasar Dinis
09d92e8278 cli/tests: port test_git_fetch to gitoxide 2025-03-05 05:39:19 +00:00
Baltasar Dinis
876262a41b cli/tests: have clone helper take in a remote name
This is relevant for the git_fetch tests
2025-03-05 05:39:19 +00:00