ok/jj
1
0
Fork 0
forked from mirrors/jj
Commit graph

6696 commits

Author SHA1 Message Date
dependabot[bot]
6fc0c7bdce github: bump the github-dependencies group across 1 directory with 2 updates
Bumps the github-dependencies group with 2 updates in the / directory: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [EmbarkStudios/cargo-deny-action](https://github.com/embarkstudios/cargo-deny-action).


Updates `actions/upload-artifact` from 4.3.4 to 4.3.5
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](0b2256b8c0...89ef406dd8)

Updates `EmbarkStudios/cargo-deny-action` from 1.6.3 to 2.0.1
- [Release notes](https://github.com/embarkstudios/cargo-deny-action/releases)
- [Commits](3f4a782664...8371184bd1)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
- dependency-name: EmbarkStudios/cargo-deny-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-05 23:12:24 -07:00
Ilya Grigoriev
dd67e4921d github actions: upgrade cargo-deny-action
Stolen from Dependabot's https://github.com/martinvonz/jj/pull/4200/
2024-08-05 22:46:31 -07:00
Ilya Grigoriev
1dc0c7698d cargo-deny: add MPL-2.0 to allowed licenses
For some reason, the current version of `cargo-deny-action` does not
require it, but the one in the next commit fails if the license is
not added.
2024-08-05 22:46:31 -07:00
Ilya Grigoriev
6e7a20edd7 cargo-deny: use the new default for deny.toml
This is needed because old keys are becoming unsupported in the next
version of the `cargo-deny` action.

This was obtained as follows:
- Run `cargo deny init`
- Modify (only) the `licenses.allow` field to match what we had before.
2024-08-05 22:46:31 -07:00
Martin von Zweigbergk
417f19d58a docs: minor updates to description of branch conflicts
Closes #4220.
2024-08-05 18:20:37 -07:00
Yuya Nishihara
d061c3782f merged_tree: remove .diff_summary()
There are no non-test callers since 452fecb7c4 "cli: colorize diff summary
and sort by path."
2024-08-06 10:15:44 +09:00
Yuya Nishihara
d435a8a793 tests: compare trees without using .diff_summary()
I don't think modification types matter here. Testing paths should be good
enough.
2024-08-06 10:15:44 +09:00
Yuya Nishihara
0b1a6cd9e0 cli: allow any number of trailing dashes in "JJ: describe" line
Because a line without " -------" is allowed, it makes sense to strip other
variants like " --".
2024-08-06 10:15:32 +09:00
Yuya Nishihara
fb3e120092 cli: minor style cleanup in parse_bulk_edit_message() 2024-08-06 10:15:32 +09:00
Yuya Nishihara
f7b8a22c66 cli: remove redundant string concatenation from parse_bulk_edit_message() 2024-08-06 10:15:32 +09:00
dependabot[bot]
1d482c71b8 cargo: bump the cargo-dependencies group with 2 updates
Bumps the cargo-dependencies group with 2 updates: [dunce](https://gitlab.com/kornelski/dunce) and [tempfile](https://github.com/Stebalien/tempfile).


Updates `dunce` from 1.0.4 to 1.0.5
- [Commits](https://gitlab.com/kornelski/dunce/compare/v1.0.4...v1.0.5)

Updates `tempfile` from 3.10.1 to 3.11.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.10.1...v3.11.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-05 18:51:04 +02:00
Yuya Nishihara
f4dd856f9f ui: do not write() to channel if builtin pager has terminated 2024-08-05 10:34:33 +09:00
Yuya Nishihara
ce2bc8d6b6 ui: include error sources in pager warning
An error in builtin pager can be nested.
2024-08-05 10:21:23 +09:00
Benjamin Tan
35b04f45dc describe: allow updating the description of multiple commits
If multiple commits are provided, the description of each commit
will be combined into a single file for editing.
2024-08-05 02:06:40 +08:00
Ilya Grigoriev
37ccfd5acc built-in pager: write a message to the user if pager failed to start
The message is printed at the end, any text sent to the pager before
then is lost. See
https://github.com/martinvonz/jj/pull/4197#discussion_r1701799135
for a discussion about why that seems OK.
2024-08-03 17:45:18 -07:00
Yuya Nishihara
9ec617534c cli: merge op heads and snapshot working copy by "op log" by default
This partially reverts 543036c753 "cli: run 'op log' without loading repo or
merging concurrent ops." User can now get around the issue by --at-op=@
--ignore-working-copy.
2024-08-03 09:22:26 +09:00
Yuya Nishihara
5bfb3742e8 cli: migrate trivial uses of op_walk::resolve_op_for_load()
Now heads merging can be turned off by --at-op=@.
2024-08-03 09:22:26 +09:00
Yuya Nishihara
2008991749 cli: do not attempt to merge op heads if --at-op=@ is specified
The idea is that --at-op specifies a certain operation, so --at-op=@ can be
interpreted as the option to select _the_ known head operation. This helps
eliminate special cases from "op log" which doesn't snapshot nor merge
concurrent ops.
2024-08-03 09:22:26 +09:00
Yuya Nishihara
b290af8e29 op_walk: include operation ids in multiple match error 2024-08-03 09:22:26 +09:00
Yuya Nishihara
e9d744db32 tests: add crash recovery test from bad GC
The current "op abandon" and "op log" have workarounds to recover from this
situation. Let's make sure they work as expected.
2024-08-03 09:22:26 +09:00
Yuya Nishihara
cf053b7e09 ui: print :builtin pager suggestion as a hint 2024-08-03 09:14:29 +09:00
Yuya Nishihara
b503ecb071 ui: rewrite request_pager() to return early and use stdout instance 2024-08-03 09:14:29 +09:00
Yuya Nishihara
47a4406f4d ui: extract finalize_pager() as UiOutput method 2024-08-03 09:14:29 +09:00
Fedor Sheremetyev
c43096ba96 docs: Fix example with Git conflicts markers 2024-08-02 10:36:38 -07:00
dependabot[bot]
32b76a2c0a cargo: bump the cargo-dependencies group with 2 updates
Bumps the cargo-dependencies group with 2 updates: [regex](https://github.com/rust-lang/regex) and [serde_json](https://github.com/serde-rs/json).


Updates `regex` from 1.10.5 to 1.10.6
- [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.10.5...1.10.6)

Updates `serde_json` from 1.0.121 to 1.0.122
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.121...v1.0.122)

---
updated-dependencies:
- dependency-name: regex
  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>
2024-08-02 18:05:14 +02:00
Martin von Zweigbergk
5b2259445e FAQ: remove workaround for fixed bug (#2476) 2024-08-01 09:07:32 -07:00
Stephen Jennings
6c41b1bef8 revset: add author_date and committer_date revset functions
Author dates and committer dates can be filtered like so:

    committer_date(before:"1 hour ago") # more than 1 hour ago
    committer_date(after:"1 hour ago")  # 1 hour ago or less

A date range can be created by combining revsets. For example, to see any
revisions committed yesterday:

    committer_date(after:"yesterday") & committer_date(before:"today")
2024-08-01 09:04:07 -07:00
Stephen Jennings
ff9e739798 revset: create DatePattern type
Creates a DatePattern type that can be created by parsing a string in any
format supported by the chrono-english crate, including:

- 2024-03-25
- 2024-03-25T00:00:00
- 2024-03-25T00:00:00-08:00
- 2 weeks ago
- 5 minutes ago
- yesterday
- yesterday 5pm
- yesterday 10:30
- yesterday 15:30
- tomorrow

A `kind` can be specified to indicate whether the pattern should match dates at
or after (`after`) or strictly before (`before`) the given instant.

chrono-english supports US and UK dialects to disambiguate mm/dd/yy from
dd/mm/yy, but for now we default to US. This should probably be a config
setting.
2024-08-01 09:04:07 -07:00
dependabot[bot]
8b5ceee180 cargo: bump the cargo-dependencies group with 3 updates
Bumps the cargo-dependencies group with 3 updates: [clap](https://github.com/clap-rs/clap), [clap_complete](https://github.com/clap-rs/clap) and [indexmap](https://github.com/indexmap-rs/indexmap).


Updates `clap` from 4.5.11 to 4.5.13
- [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.11...v4.5.13)

Updates `clap_complete` from 4.5.11 to 4.5.12
- [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.11...clap_complete-v4.5.12)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-01 17:51:43 +02:00
Essien Ita Essien
7c4185cd41 Change conflict hint depending on state of working commit.
To avoid always printing the rebase instructions to fix a conflict
even when a child commit to fix the conflict already exists, implement
the following:

* If working commit has conflicts:
  * Continue printing the same message we print today.

* If working commit has no conflicts:
  * If any parent has conflicts, we print: "Conflict in parent is resolved in working copy".
    Also explicitly not printing the "conflicting parent" here, since a merge commit
    could have conflict in multiple parents.
  * If no parent has any conflicts: exit quietly.
* Update unittests for conflict hinting update.
* Update CHANGELOG
2024-08-01 16:21:24 +01:00
Yuya Nishihara
d0f6f429e1 diff: add "diff" label globally by outer show_diff/patch() functions
It's not so important, but this removes duplicated "diff" labels from template
output. Perhaps, this also fixes "diff access-denied" label in file-by-file
external diffs.

The inner show_*() functions no longer add "diff" labels, but that's okay
because all CLI callers (except for the templater) use DiffRenderer.
2024-08-01 22:56:36 +09:00
Yuya Nishihara
07b0b0676d tests: rerun commit.diff() template test with --color=debug
The added test shows the "diff" label is repeated because of auto-labeling of
templater. The original "--color=always" test is also kept to ensure that color
sequences are unchanged even if we remove one of the "diff" labels.
2024-08-01 22:56:36 +09:00
Yuya Nishihara
052f022479 formatter: make error type of with_label() callback generic
This will help eliminate push/pop_label() calls from show_diff_*().
2024-08-01 22:56:36 +09:00
Yuya Nishihara
f57a7e5eba cli: move cmd_config_list() entry point next to Args struct 2024-08-01 09:54:12 +09:00
Yuya Nishihara
9168500341 cli: split commands/config.rs into sub modules 2024-08-01 09:54:12 +09:00
dploch
bfa1ce8936 workspace: make the constructor public
This allows constructing a workspace in a custom environment where the standard filesystem API cannot be used
2024-07-31 19:45:37 -04:00
dploch
5f7e3883e8 repo: define a public constructor for RepoLoader
This enables the creation of Repo objects in environments without standard filesystem support, by allowing the caller to load the store objects however they see fit. This confines interaction with the filesystem to the WorkingCopy abstractions.
2024-07-31 19:45:37 -04:00
Yuya Nishihara
dc2b5500ff diff: specify available terminal width by caller, subtract graph width
The width parameter is mandatory so it wouldn't fall back to ui.term_width() by
mistake. The API is getting messy and we might want to extract some parameters
to separate struct.

Fixes #4158
2024-08-01 02:03:03 +09:00
Yuya Nishihara
1977748642 ui: fill in default term width globally and return as usize
I'm going to add more ui.term_width() callers, and it's unlikely we'll have to
set different defaults or error out.
2024-08-01 02:03:03 +09:00
Yuya Nishihara
b2b86825cb cli: move cmd_workspace_update_stale() entry point next to Args struct 2024-07-31 10:21:34 +09:00
Yuya Nishihara
21e1ce4f50 cli: split commands/workspace.rs into sub modules 2024-07-31 10:21:34 +09:00
Yuya Nishihara
a39dd0f176 cli: duplicate cmd_workspace_root() to cmd_root()
Suppose cmd_root() will gain options to print other kind of root paths, it's
probably simpler to inline path handling there instead of turning cmd_root()
into a dispatcher function. If cmd_root() remains with the current form, maybe
we can add aliases.root = ["workspace", "root"] instead.
2024-07-31 10:21:34 +09:00
Danny Hooper
51e11ff7e3 cli: fix: replace obsolete todo with a new one 2024-07-29 14:23:26 -05:00
dependabot[bot]
a17d97a2ca github: bump ossf/scorecard-action in the github-dependencies group
Bumps the github-dependencies group with 1 update: [ossf/scorecard-action](https://github.com/ossf/scorecard-action).


Updates `ossf/scorecard-action` from 2.3.3 to 2.4.0
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](dc50aa9510...62b2cac7ed)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-29 11:58:10 -05:00
dependabot[bot]
0b7a24e3f5 cargo: bump the cargo-dependencies group with 2 updates
Bumps the cargo-dependencies group with 2 updates: [serde_json](https://github.com/serde-rs/json) and [tokio](https://github.com/tokio-rs/tokio).


Updates `serde_json` from 1.0.120 to 1.0.121
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.120...v1.0.121)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-29 17:42:16 +02:00
Ilya Grigoriev
ce2982492a cargo: enable vendored-libgit2, document how to properly dynamically link libgit2
This changes less than it seems. Our CI builds already mostly linked a vendored
copy of libgit2. This is because before this commit, it turns out that `git2`
could link `libgit2` *either* statically or dynamically based on whether it could
find a version of libgit2 it liked to link dynamically. Our CI builds usually did
not provide such a version AFAIK.

This made the kind of binary `cargo install` would produce unpredictable and may
have contributed to #2896.  I was once very surprised when I did `brew upgrade libgit2` and then
`cargo build --release` suddenly switched from building dynamically linked `jj` to the vendored version.

Instead, if a packager wants to link `libgit2` dynamically, they should set an
environment variable, as described inside the diff of this commit. I also think
we should recommend static linking as `git2` is quite picky about the versions of
`libgit2` it supports. See also https://github.com/rust-lang/git2-rs/pull/1073

This might be related to #4115.
2024-07-28 12:51:30 -07:00
Scott Taylor
304f6dfc3f workspace: warn if destination doesn't contain path separator
Users may try to run `jj workspace add <name>` without specifying a
path, which results in the workspace being created in the current
directory. This can be confusing, since the workspace contents will also
be snapshotted in the original workspace if it is not sparse. Adding a
warning should reduce confusion in this case.
2024-07-26 18:37:11 -05:00
Scott Taylor
4d8eee3416 test: update workspace path in test case
This test case was creating "workspace1" as a sub-directory of the
default workspace, which seems like a mistake.
2024-07-26 18:37:11 -05:00
dependabot[bot]
8eb1dca983 cargo: bump the cargo-dependencies group with 2 updates
Bumps the cargo-dependencies group with 2 updates: [bstr](https://github.com/BurntSushi/bstr) and [version_check](https://github.com/SergioBenitez/version_check).


Updates `bstr` from 1.9.1 to 1.10.0
- [Commits](https://github.com/BurntSushi/bstr/compare/1.9.1...1.10.0)

Updates `version_check` from 0.9.4 to 0.9.5
- [Commits](https://github.com/SergioBenitez/version_check/compare/v0.9.4...v0.9.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-26 16:10:15 +00:00
dependabot[bot]
c9b34b3982 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 3.25.14 to 3.25.15
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](5cf07d8b70...afb54ba388)

---
updated-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>
2024-07-26 18:02:59 +02:00