Commit graph

6312 commits

Author SHA1 Message Date
Ilya Grigoriev
1f7c4ec60a conflicts: label closing delimeter with conflict number
This follows up on https://github.com/martinvonz/jj/pull/3459 and adds a
label to the closing delimeter of each conflict, e.g.  "Conflict 1 of 3
ends".

I didn't initially put any label at the ending delimeter since the
starting delimeter is already marked with "Conflict 1 of 3". However,
I'm now realizing that when I resolve conflicts, I usually go from top
to bottom. The first thing I do is delete the starting conflict
delimeter. It is when I get to the *end* of the conflict that I wonder
whether there are any more conflicts left in the file.
2024-05-20 18:36:51 -07:00
dependabot[bot]
7812beb087 github: bump github/codeql-action in the github-dependencies group
Bumps the github-dependencies group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 2.13.4 to 3.25.6
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](cdcdbb5797...9fdb3e4972)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-20 16:10:46 +00:00
dependabot[bot]
990c48a9bc cargo: bump the cargo-dependencies group with 7 updates
Bumps the cargo-dependencies group with 7 updates:

| Package | From | To |
| --- | --- | --- |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.83` | `1.0.86` |
| [libc](https://github.com/rust-lang/libc) | `0.2.153` | `0.2.155` |
| [proc-macro2](https://github.com/dtolnay/proc-macro2) | `1.0.82` | `1.0.83` |
| [prost](https://github.com/tokio-rs/prost) | `0.12.4` | `0.12.6` |
| [prost-build](https://github.com/tokio-rs/prost) | `0.12.4` | `0.12.6` |
| [syn](https://github.com/dtolnay/syn) | `2.0.64` | `2.0.65` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.60` | `1.0.61` |


Updates `anyhow` from 1.0.83 to 1.0.86
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.83...1.0.86)

Updates `libc` from 0.2.153 to 0.2.155
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.153...0.2.155)

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

Updates `prost` from 0.12.4 to 0.12.6
- [Release notes](https://github.com/tokio-rs/prost/releases)
- [Commits](https://github.com/tokio-rs/prost/compare/v0.12.4...v0.12.6)

Updates `prost-build` from 0.12.4 to 0.12.6
- [Release notes](https://github.com/tokio-rs/prost/releases)
- [Commits](https://github.com/tokio-rs/prost/compare/v0.12.4...v0.12.6)

Updates `syn` from 2.0.64 to 2.0.65
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.64...2.0.65)

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

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: prost
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: prost-build
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-20 15:54:47 +00:00
Remo Senekowitsch
c9375bf76f docs: fix converting a repo into a co-located one
`jj st` doesn't add the file `.git/refs/heads/main` so the git repo is left
in an invalid state. `jj new @-` puts the git repo in a valid state.
2024-05-20 21:39:27 +09:00
Yuya Nishihara
c04fb7d33a templater: migrate to generic dsl_util::AliasesMap type 2024-05-20 10:32:18 +09:00
Yuya Nishihara
2cbc4f9996 revset: extract generic dsl_util::AliasesMap<P> type
As I'm going to extract generic alias substitution helpers, there should be
a common map type.
2024-05-20 10:32:18 +09:00
Yuya Nishihara
6916fae853 revset, templater: extract trait that parses alias declaration
Revset/TempalteAliasesMap will be extracted as a generic map type over
P: AliasDeclarationParser.
2024-05-20 10:32:18 +09:00
Yuya Nishihara
467d73f1e6 revset: make .get_symbol/function() compatible with TemplateAliasesMap
These map types will be combined.
2024-05-20 10:32:18 +09:00
Yuya Nishihara
3db1f9fe5d revset: extract aliases_map.function_names()
TemplateAliasesMap has a similar function for symbols, and I'm going to extract
a common aliases map type.
2024-05-20 10:32:18 +09:00
Yuya Nishihara
60c3f623ef tests: use get_branch_output() helper thoroughly in test_git_* 2024-05-19 22:45:32 +09:00
Waleed Khan
6eefad9b67 docs: Add Log header
There are six related settings that would be good to group in the table of contents.
2024-05-18 16:39:28 -07:00
Philip Metzger
bbb9ca10cd lib: Add RevsetExpression::is_empty(), which filters out empty commits.
This is a useful helper for programmatic revsets. Users were also migrated.
2024-05-19 00:20:05 +02:00
Yuya Nishihara
6d211c589c templater: consolidate node.span handling in expand_node()
I'll probably rewrite expand_aliases() in visitor-like interface, and tree
traversal logic will be implemented on ExpressionKind. That's why I made
expand_node() destructure ExpressionNode first.
2024-05-18 09:53:52 +09:00
Yuya Nishihara
6b9e5f7cd7 templater: attach alias traces to function parameter
This consolidates the type of substitution results. Before, symbol substitution
can return inner ExpressionKind internally, but function-parameter substitution
couldn't.
2024-05-18 09:53:52 +09:00
Yuya Nishihara
47d372b71e templater: attach alias traces to type errors
This should avoid regression caused by upcoming changes. An alias function
parameter will be wrapped with AliasExpanded, and type errors in it should
be reported with its alias expansion stack.
2024-05-18 09:53:52 +09:00
Yuya Nishihara
3e51e93265 fileset: box FunctionCallNode to make enum smaller
For the same reason as the previous commit.
2024-05-18 09:53:52 +09:00
Yuya Nishihara
e87b49ccc1 templater: move boxing to ExpressionKind variants to make the enum smaller
I'm trying to extract generic alias substitution functions, and some of them
will take ExpressionKind or Box<FunctionCallNode> by value, then return it or
substituted value of the same type. The cost of moving values wouldn't matter
in practice, but I think it's better to keep the value types small.

Now ExpressionKind is 4-word long.
2024-05-18 09:53:52 +09:00
Martin von Zweigbergk
fe9daac483 tests: avoid deprecated jj init --git/--git-repo
I left the instances in `test_init_command.rs` alone since they're
about testing `jj init`.
2024-05-17 13:55:20 -07:00
dependabot[bot]
ef6cb06fde cargo: bump the cargo-dependencies group with 2 updates
Bumps the cargo-dependencies group with 2 updates: [either](https://github.com/rayon-rs/either) and [syn](https://github.com/dtolnay/syn).


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

Updates `syn` from 2.0.63 to 2.0.64
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.63...2.0.64)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-17 12:34:02 -07:00
dependabot[bot]
7457085829 github: bump actions/checkout in the github-dependencies group
Bumps the github-dependencies group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 4.1.5 to 4.1.6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](44c2b7a8a4...a5ac7e51b4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-17 12:33:39 -07:00
jyn
0d3e949439 give a warning when trying to redefine a built-in command
previously, aliases to built-in commands were silently ignored. this matches git's behavior, but seems unhelpful, especially if the user doesn't know that a command with that name already exists.
give a warning rather than silently ignoring it.
2024-05-17 16:50:54 +01:00
Martin von Zweigbergk
8e0ac1d167 docs: conflicted branches have two "?" as suffix
Looks like we forgot to update this when we changed from one to two
question marks.
2024-05-17 07:00:15 -07:00
Théo Daron
0a48ac63cb cli: make jj branch track show conflicts 2024-05-17 12:21:10 +02:00
Théo Daron
69d44375dc cargo: downgrade libc to 0.2.153 2024-05-17 12:21:10 +02:00
Martin von Zweigbergk
c34f35fffe cargo: downgrade off of yanked prost version 2024-05-16 14:22:00 -07:00
dependabot[bot]
b3dac82ee7 cargo: bump the cargo-dependencies group with 2 updates
Bumps the cargo-dependencies group with 2 updates: [prost](https://github.com/tokio-rs/prost) and [prost-build](https://github.com/tokio-rs/prost).


Updates `prost` from 0.12.4 to 0.12.5
- [Release notes](https://github.com/tokio-rs/prost/releases)
- [Commits](https://github.com/tokio-rs/prost/compare/v0.12.4...v0.12.5)

Updates `prost-build` from 0.12.4 to 0.12.5
- [Release notes](https://github.com/tokio-rs/prost/releases)
- [Commits](https://github.com/tokio-rs/prost/compare/v0.12.4...v0.12.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-16 10:45:22 -05:00
Martin von Zweigbergk
66aced5dc8 merge_view: remove heads removed by other side also in Google repos
When I addded the workaround in 256988de65, I missed the comment
just below explaining that heads removed by the other side were
already handled. Since that's not handled when using non-default
indexes now, we need to handle it in an `else` block.
2024-05-16 06:09:59 -07:00
dependabot[bot]
0a39cfdbe2 cargo: bump the cargo-dependencies group with 2 updates
Bumps the cargo-dependencies group with 2 updates: [insta](https://github.com/mitsuhiko/insta) and [serde](https://github.com/serde-rs/serde).


Updates `insta` from 1.38.0 to 1.39.0
- [Release notes](https://github.com/mitsuhiko/insta/releases)
- [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mitsuhiko/insta/compare/1.38.0...1.39.0)

Updates `serde` from 1.0.201 to 1.0.202
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.201...v1.0.202)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-15 19:47:49 +02:00
Ilya Grigoriev
0d0f8af05d docs CLI reference: explain that argument help is truncated
Perhaps this will help with issues like
https://github.com/martinvonz/jj/issues/3667
2024-05-15 09:45:40 -07:00
Ilya Grigoriev
c9b44f3828 docs: ask MkDocs to fail on links to non-existent sections
This also requires anchors to be lower-cased: https://github.com/mkdocs/mkdocs/issues/3703
2024-05-14 13:14:27 -07:00
Ilya Grigoriev
4907a384b9 docs: update dependency versions, poetry update 2024-05-14 13:14:27 -07:00
Yuya Nishihara
b9039c3c2d cli: remove unneeded lifetime bound from check_rewritable() 2024-05-14 19:45:52 +09:00
Théo Daron
b1fca954cf fix: changelog entry for PR #3600 2024-05-14 12:14:46 +02:00
Théo Daron
823041c795 cli: create new wc_commit when wc_commit become immuable 2024-05-14 08:53:11 +02:00
Yuya Nishihara
b0d17acb30 merge_tools: leverage Display for printing exit status
This should handle signal exits better. format_tool_aborted() is inlined
because it is more or less a string literal now.
2024-05-14 10:24:28 +09:00
Yuya Nishihara
c17a75624e signing: remove redundant "exit status" from SSH backend error
Follows up 550f44b7c1 "gpg: drop redundant "exit status" from error message."
2024-05-14 10:24:28 +09:00
Yuya Nishihara
a61f91b8cf templater: propagate error from commit.parents() method 2024-05-14 10:24:11 +09:00
Yuya Nishihara
1b6589a463 cli: add helper functions that set up diff renderer based on command args
Just for convenience. Even though WorkspaceCommandHelper is getting bloated,
I think it's okay to add thin wrapper functions there.
2024-05-14 09:36:13 +09:00
Yuya Nishihara
4d9c84a17e diff_util: remove WorkspaceCommandHelper dependency from show functions
I've added a wrapper struct in order to get around too many arguments warning.
It captures &dyn Repo as CommitTemplateLanguage would do. OTOH, &Ui is passed
by argument because the caller might need &mut Ui after the renderer object was
configured.
2024-05-14 09:36:13 +09:00
Yuya Nishihara
7341bff2f4 diff_util: remove WorkspaceCommandHelper dependency from inner show functions
I've added a struct similar to RevsetWorkspaceContext. It can be a closure,
but we'll need to duplicate format_file_path() function anyway if we add
commit.diff() template.
2024-05-14 09:36:13 +09:00
Yuya Nishihara
b6d95c3504 cli: use high-level show_diff() function in cmd_status()
As I'm going to remove &WorkspaceCommandHelper from these functions, it will
be a bit more verbose to call low-level show_*() functions.
2024-05-14 09:36:13 +09:00
Yuya Nishihara
13f10f6957 diff_util: pass repo in to inner show functions by argument
I'm going to remove &WorkspaceCommandHelper dependency. This is the easy part.
2024-05-14 09:36:13 +09:00
Yuya Nishihara
6e7c9f15fd diff_util: pass term_width() in to show_diff_stat() by argument
This patch removes ui dependency from show_diff_stat().
2024-05-14 09:36:13 +09:00
Yuya Nishihara
f614c96383 diff_util: remove CommandError dependency from show functions
Suppose we add commit.diff() template method, some of these show_*() functions
will be called from there. CommandError shouldn't appear in that layer.
2024-05-14 09:36:13 +09:00
dependabot[bot]
b1fc2cf7e9 cargo: bump syn from 2.0.61 to 2.0.63 in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [syn](https://github.com/dtolnay/syn).


Updates `syn` from 2.0.61 to 2.0.63
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.61...2.0.63)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-13 12:34:23 -05:00
Ilya Grigoriev
02b72e542d docs: try upgrading mkdocs-material again, upgrade MkDocs
https://github.com/squidfunk/mkdocs-material/issues/7160 is supposed to
be fixed now. I will double-check that the version switcher still works
after this commit. This only affects the version switcher from
"prerelease" to other versions.. The functionality is a bit brittle, so
it's hard to test locally before merging this.

We do want to upgrade, since this allows us (and seems to also require
us) to upgrade to MkDocs 1.6, which has a nice feature of disallowing
links to broken document section (beyond just checking for links to
non-existent files).

I carefully avoided unnecessary upgrades in this commit, but we
should also run `poetry update` shortly, once we check this
works properly. Also, the feature of MkDocs 1.6 I mentioned needs
enabling.

Finally, I plan to change version specifiers from Poetry's `^5.6.22`
syntax to more plain inequalities, since I keep forgetting what the
former syntax means. I started with this commit.

(I was surprised MkDocs was allowed to be upgraded to `1.6` with the
`^1.5.2` spec.  I now suspect that what I previously thought it should
mean is expressed as `~1.5.2`, but inequalities are clearer).
2024-05-13 09:14:33 -07:00
Martin von Zweigbergk
550f44b7c1 gpg: drop redundant "exit status" from error message
Apparently we currently get things like "GPG failed with exit status
exit status: 2".
2024-05-13 08:30:00 -07:00
Martin von Zweigbergk
ee9d3271c1 cleanup: propagate errors from Commit::predecessors() 2024-05-13 07:39:14 -07:00
Martin von Zweigbergk
0a758e7024 cleanup: propagate errors from Commit::parents()
The function now returns an iterator over `Result`s, matching
`Operation::parents()`.

I updated callers to also propagate the error where it was trivial.
2024-05-13 07:39:14 -07:00
Martin von Zweigbergk
677081ef71 rebase: avoid an unnecessary lookup of parent commits 2024-05-13 07:39:14 -07:00