Commit graph

7967 commits

Author SHA1 Message Date
Yuya Nishihara
721aecb4cc config: add public ConfigLayer::ensure_table() function
It's not uncommon to insert new table at a certain path. This could be modelled
as set_table(name, new_table), but the caller might want to merge items with
the existing table if any. This function can be used for both cases.
2025-01-22 01:01:04 +00:00
Yuya Nishihara
d9e0fb7974 config: add migration type that runs user-specified function
This was needed in order to migrate fix.tool-command to [fix.tools] table. We
don't have other use cases right now, but there will be something in future.
2025-01-22 01:01:04 +00:00
Yuya Nishihara
ffaaf89f05 config: add migration type that renames and updates value
This will be used in order to migrate boolean value to enum, for example.
2025-01-22 01:01:04 +00:00
Yuya Nishihara
9d77ad5594 config: add separate type for migration error, attach source path
Migration can fail because of unexpected value type, etc.
2025-01-22 01:01:04 +00:00
Ilya Grigoriev
231c968f51 dynamic completion: complete jj git push {-r,-c}
I had to guess whether to complete all revisions or just mutable ones. I'm
guessing that `-r` is sometimes used with immutable revisions (as part of a
revset, or for creating special-purpose branches), while `-c` is almost always
used to push a mutable revision. We can change it later if my guess is wrong.
2025-01-22 00:45:46 +00:00
Ilya Grigoriev
cf69a36a62 dynamic completion: add revision completion to hidden -r arguments
Before this commmit, `jj desc <tab>` resulted in revision completions, but the equivalent `jj desc -r <tab>` didn't.
2025-01-22 00:45:46 +00:00
Yuya Nishihara
a6f20cf42f graph: make reverse_graph() accept separate node id type
Although extra clone/IO wouldn't matter in practice, we can simplify callers
by constructing the edges list to be passed to the graph renderer.
2025-01-22 00:44:42 +00:00
Yuya Nishihara
b70d0c50e1 graph: remove redundant clone from reverse_graph()
All input nodes should be unique.
2025-01-22 00:44:42 +00:00
Ilya Grigoriev
5dbc4ae619 actions: fix codespell CI failure
It is having a fit for some reason, see e.g.
https://github.com/jj-vcs/jj/actions/runs/12897590111/job/35963026619?pr=5414

Not sure what changed, but here is a quick fix.

A likely cause is
https://github.com/codespell-project/codespell/releases/tag/v2.4.0 .
It'd be cool to fix the version of codespell the action uses, but I
couldn't find a way to do it quickly.
2025-01-22 00:20:33 +00:00
dependabot[bot]
cff86ed5fa github: bump taiki-e/install-action in the github-dependencies group
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
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.47.19 to 2.47.21
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](24758ef6e7...da41fb311f)

---
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-01-21 16:46:20 +00:00
dependabot[bot]
1a2bf50fa1 cargo: bump clap from 4.5.26 to 4.5.27 in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [clap](https://github.com/clap-rs/clap).


Updates `clap` from 4.5.26 to 4.5.27
- [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.26...clap_complete-v4.5.27)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-21 16:45:52 +00:00
Martin von Zweigbergk
be32d4e3ef cli: rebase: say that -r allows set, clarify -s X vs -r X:: 2025-01-21 06:43:15 +00:00
Yuya Nishihara
4a50a35046 cli: abandon: delete bookmarks pointing to abandoned 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
Based on the discussion in #3505, I think the sliding behavior isn't favored at
least for "jj abandon". This patch changes the default to delete bookmarks.

"jj rebase --skip-emptied" can also be updated if needed. It might be good for
consistency. However, I'm skeptical about changing the default of the internal
API. It's not easy to add generic reporting mechanism for deleted/abandoned
bookmarks. If we added one in report_repo_changes(), redundant message would be
printed on "jj git fetch". So I think callers should enable the deletion
explicitly.

Closes #3505
2025-01-21 02:37:07 +00:00
Yuya Nishihara
686ab24a5c cli: abandon: use transform_descendants() to do reparent/rebase conditionally
This will help implement "jj abandon --retain-bookmarks".
2025-01-21 02:37:07 +00:00
Yuya Nishihara
c50a70906b rewrite: add option to delete abandoned bookmarks
I'll make "jj abandon" delete bookmarks by default. This could be handled by
cmd_abandon(), but we'll need a repo API if we also want to change the behavior
of "jj rebase --skip-emptied".
2025-01-21 02:37:07 +00:00
Yuya Nishihara
ace041ec96 rewrite: add a few more bookmarks to abandoning test, remove redundant assertion 2025-01-21 02:37:07 +00:00
Yuya Nishihara
a3636d8a83 revset: add subject() predicate that matches first line of descriptions
It's generally useful, and we can get by without introducing weird special case
about newline terminator.

Closes #5227
2025-01-21 02:13:04 +00:00
dependabot[bot]
3d7858df26 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 [serde_json](https://github.com/serde-rs/json).


Updates `indexmap` from 2.7.0 to 2.7.1
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.7.0...2.7.1)

Updates `serde_json` from 1.0.135 to 1.0.137
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.135...v1.0.137)

---
updated-dependencies:
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-21 02:03:44 +00:00
dependabot[bot]
37e2c360cb 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.47.15 to 2.47.19
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](d125c0a835...24758ef6e7)

---
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-01-21 01:40:53 +00:00
Yuya Nishihara
9663509643 cli: handle remote configuration error on "git clone" 2025-01-21 01:19:15 +00:00
Yuya Nishihara
2415c96cd8 cli: split do_git_clone() function to reduce number of arguments 2025-01-21 01:19:15 +00:00
Yuya Nishihara
5577ffd28d revset: split author()/committer() into _name()/email() predicates
It seemed weird that we don't have primitive functions to query either name or
email field. This also fixes mine() to not match against name.
2025-01-21 01:10:00 +00:00
Yuya Nishihara
206acadd49 revset: remove stale comment about regex pattern 2025-01-21 01:10:00 +00:00
George Christou
9314df9e38 formatter: add support for italic text 2025-01-20 17:46:27 +00:00
Valentin Gatien-Baron
019bd8f757 restore: add --into flag, make --to an alias to it
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
This is a part of #5394.
2025-01-19 20:17:44 +00:00
Ilya Grigoriev
027589d199 cleanup: remove WatchmanConfig Default impl
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
This one was actually used, but only in a debug command.
2025-01-18 07:49:43 +00:00
Ilya Grigoriev
3404085ec4 cleanup: remove Conflict default impl
The "default" conflict is not a valid conflict, as it
does not have one more add than removes.
2025-01-18 07:49:43 +00:00
Ilya Grigoriev
5daa138cd7 cleanup: remove a bunch of unused Default impls
I noticed that some config structures do not use their "Default" implementation, and have their default specified in a TOML file. I think specifying defaults in TOML is great, and it'd be good to delete those Default implementations, so that it does not diverge from the default in the TOML file.
2025-01-18 07:49:43 +00:00
Yuya Nishihara
83d40d2c42 repo: move rebase_descendants_with_options_return_map() to tests
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-01-18 01:21:28 +00:00
Yuya Nishihara
15f4ac5f12 repo: add rebase_descendants_*() that takes callback instead of returning map
There's only one non-test caller who doesn't need a complete map of rebased
commits.

FWIW, I tried to rewrite squash_commits() based on transform_descendants() API,
but it wasn't easy because of A-B+A=A rule. The merge order matters here.
2025-01-18 01:21:28 +00:00
Yuya Nishihara
e3efb0d614 rewrite: pass RebaseOptions by reference
Since we've removed DescendantRebaser, it no longer makes sense to pass options
by value. This patch also replaces Default::default() for clarity.
2025-01-18 01:21:28 +00:00
dependabot[bot]
dbb9e7e9f9 github: bump the github-dependencies group with 2 updates
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
Bumps the github-dependencies group with 2 updates: [taiki-e/install-action](https://github.com/taiki-e/install-action) and [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv).


Updates `taiki-e/install-action` from 2.47.14 to 2.47.15
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](e26ea2a159...d125c0a835)

Updates `astral-sh/setup-uv` from 5.2.0 to 5.2.1
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](4e3dbecc19...b5f58b2abc)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-17 17:37:24 +00:00
Vincent Ging Ho Yim
661c443dbc docs/contributing: fix incorrect bookmark name 2025-01-17 12:23:24 +00:00
Vincent Ging Ho Yim
efb9be4e55 changelog: remove extraneous parentheses 2025-01-17 12:22:05 +00:00
Vincent Ging Ho Yim
a44ec17c9a changelog: add missing comma 2025-01-17 12:22:05 +00:00
Yuya Nishihara
5d1f3d006d repo: pass &Commit to record_abandoned_commit() to simplify error handling
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-01-17 00:28:25 +00:00
Yuya Nishihara
8833a7adc7 repo: propagate error from record_rewrites() 2025-01-17 00:28:25 +00:00
Yuya Nishihara
cb981c7bf1 git: propagate error from abandon_unreachable_commits() 2025-01-17 00:28:25 +00:00
dependabot[bot]
34447d7ecc 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 [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv).


Updates `taiki-e/install-action` from 2.47.13 to 2.47.14
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](6ae49f1b8b...e26ea2a159)

Updates `astral-sh/setup-uv` from 5.1.0 to 5.2.0
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](887a942a15...4e3dbecc19)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-16 17:33:22 +00:00
Yuya Nishihara
646bdabe62 absorb: print status if source commit still contains diffs
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
Closes #5362
2025-01-16 01:09:33 +00:00
Yuya Nishihara
e910ac4040 absorb: wrap absorb_hunks() result in struct
This patch also renames rewritten_commits as I'm going to add rewritten_source
field.
2025-01-16 01:09:33 +00:00
Yuya Nishihara
3711979a8f absorb: show warning if source commit contains file deletion 2025-01-16 01:09:33 +00:00
Bryce Berger
f7431650be templates: add cryptographic_signature display to default formats
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
Cryptographic signature support in templates was added in
c99c97c646 (#4853), but has to be manually
configured. This adds some defaults to the built-in config.

Instead of having separate `builtin_*_with_sig` aliases, this adds to
the aliases that actually format commits. Since signature verification
is slow, this is disabled by default. To enable it, override
`ui.show-cryptographic-signatures`:

    [ui]
    show-cryptographic-signatures = true
    [template-aliases]
    'format_short_cryptographic_signature(signature)' = ...
    'format_detailed_cryptographic_signature(signature)' = ...

Note that the two formatting functions take
`Option<CryptographicSignature>`, not `CryptographicSignature`. This
allows you to display a custom message if a signature is not found, but
will emit an error if you do not check for signature presence.

    [template-aliases]
    'format_detailed_cryptographic_signature(signature)' = '''
      if(signature,
        "message if present",
        "message if missing",
      )
    '''
2025-01-15 23:29:35 +00:00
dependabot[bot]
83add0f338 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.47.12 to 2.47.13
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](333ea3e9a4...6ae49f1b8b)

---
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-01-15 18:48:37 +00:00
Charlie-83
ae8f6a3837 docs: fix incorrect XDG env variable 2025-01-15 18:06:02 +00:00
Yuya Nishihara
4dd554aa69 revset: parse unicode XID_CONTINUE characters as symbol
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
Tag and bookmark names are usually ASCII, but they occasionally include Latin
or Han characters.

This doesn't fix the serialization problem, but should mitigate #5359.
2025-01-15 07:24:10 +00:00
Yuya Nishihara
284aee25a9 revset: duplicate Rule::identifier to strict_identifier, replace some usages
The "identifier" rule will be changed to accept unicode characters. It's not
super important to reject non-ASCII string pattern prefixes or alias symbols,
but this is more consistent with templater and fileset. We can relax the rule
later if needed.
2025-01-15 07:24:10 +00:00
Yuya Nishihara
0fbf2913ac revset: extract identifier/at_op parsing tests to separate functions
I'm going to add some unicode characters there, and the current test function
is pretty big.
2025-01-15 07:24:10 +00:00
Yuya Nishihara
f9906dc403 cli: add "git.push-new-bookmarks" config knob to enable --allow-new by default
This goes against our rule that we shouldn't add config knob that changes the
command behavior, but I don't have any other idea to work around the problem.
Apparently, there are two parties, one who always wants to push new bookmarks,
and the other who mildly prefers to push&track new bookmarks explicitly.
Perhaps, for the former, creation of bookmarks means that the target branches
are marked to be pushed.

The added flag is a simple boolean. "non-tracking-only" behavior #5173 could be
implemented, but I don't want to complicate things. It's a failed attempt to
address the issue without introducing config knob.

Closes #5094
Closes #5173
2025-01-15 07:23:43 +00:00
Ilya Grigoriev
c3c2e882c9 docs config: an advanced example of --config syntax
This seems non-trivial to discover and could be useful for people
transitioning from `--config-toml`.
2025-01-15 05:25:23 +00:00