8712 Commits

Author SHA1 Message Date
Baltasar Dinis
a19787d2d4 cli/tests: port test_git_push to gitoxide 2025-03-05 05:39:19 +00:00
Baltasar Dinis
c2a92fce37 cli/tests: port test_git_remotes to gitoxide 2025-03-05 05:39:19 +00:00
Yuya Nishihara
4de95ac2f5 cli: reimplement "jj revert" stub as error hint
We might rename "jj backout" to "jj revert", but until then, user can add alias
as they want.

Closes #5335
Closes #5701
2025-03-05 05:22:51 +00:00
Yuya Nishihara
7711fc14e6 cli: sort debug commands lexicographically 2025-03-05 05:22:45 +00:00
Baltasar Dinis
61f3732ad8 docs: update the docs to best describe the authentication compatibility 2025-03-05 04:33:57 +00:00
Ilya Grigoriev
d446a85c4a cli: make init and clone print a friendly error but be overridable with aliases
The main goal here is so that a completely new user that types in `jj
init` or `jj clone` gets a pointer to the correct command needed to try
out `jj`.
2025-03-05 02:53:48 +00:00
Ilya Grigoriev
22bc271a7b cli: move jj init to jj debug init-local
We could also incorporate parts of #5827 later.
2025-03-05 02:53:48 +00:00
Ilya Grigoriev
8bd7d3daea test_global_opts: use the Git backend
Follows up on #5875
2025-03-05 02:53:48 +00:00
dependabot[bot]
f1bb889473 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 [EmbarkStudios/cargo-deny-action](https://github.com/embarkstudios/cargo-deny-action).


Updates `taiki-e/install-action` from 2.49.10 to 2.49.13
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](3c8fc6eaa5...970d55e3ce)

Updates `EmbarkStudios/cargo-deny-action` from 2.0.6 to 2.0.10
- [Release notes](https://github.com/embarkstudios/cargo-deny-action/releases)
- [Commits](0484eedcba...4de59db63a)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  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-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-05 01:35:59 +00:00
Martin von Zweigbergk
88157c32b9 tests: avoid using the local backend
Now that we depend on the `git` executable being available for `jj git
fetch/push` tests, we might as well use it for `jj util gc` tests
too.

I also switched to using the Git backend in
`cli/tests/test_file_track_untrack_commands.rs`, which seemed to be
using the local backend for no good reason.
2025-03-04 22:12:17 +00:00
Jonathan Tan
507e4b033d lib/testutils/Cargo.toml: remove unused gix feature
The gix feature "blocking-network-client" was configured in cd6141693
(cli/tests: add gitoxide helpers, 2025-02-03) most likely because
we needed to clone using gix in tests, but 071e724c1 (cli/tests:
move test_git_colocated_fetch_deleted_or_moved_bookmark to gitoxide,
2025-02-25) changed the test to clone by subprocessing out to system git
(not by using gitoxide, as a cursory read of the commit description may
indicate), meaning that we no longer need that feature.

Therefore, remove that feature.
2025-03-04 20:39:20 +00:00
Ilya Grigoriev
02e2f06e7a mkdocs: Suppress a warning that paid_contibutors.md is not in nav
The warning this suppresses is shown by `mkdocs serve`:

```
INFO    -  The following pages exist in the docs directory, but are not included in the "nav" configuration:
             - paid_contributors.md
```

We can alternatively add that doc to nav.
2025-03-04 20:00:12 +00:00
Scott Taylor
a95281f9ca docs: fix syntax highlighting for conflicts.md
I think the `diff` syntax highlighting makes these examples harder to
read since it's inconsistent and wouldn't appear in real conflicts.
2025-03-03 22:42:14 +00:00
dependabot[bot]
cf3b45878e cargo: bump the cargo-dependencies group with 9 updates
Bumps the cargo-dependencies group with 9 updates:

| Package | From | To |
| --- | --- | --- |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.96` | `1.0.97` |
| [async-trait](https://github.com/dtolnay/async-trait) | `0.1.86` | `0.1.87` |
| [insta](https://github.com/mitsuhiko/insta) | `1.42.1` | `1.42.2` |
| [proc-macro2](https://github.com/dtolnay/proc-macro2) | `1.0.93` | `1.0.94` |
| [quote](https://github.com/dtolnay/quote) | `1.0.38` | `1.0.39` |
| [ref-cast](https://github.com/dtolnay/ref-cast) | `1.0.23` | `1.0.24` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.139` | `1.0.140` |
| [syn](https://github.com/dtolnay/syn) | `2.0.98` | `2.0.99` |
| [thiserror](https://github.com/dtolnay/thiserror) | `2.0.11` | `2.0.12` |


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

Updates `async-trait` from 0.1.86 to 0.1.87
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.86...0.1.87)

Updates `insta` from 1.42.1 to 1.42.2
- [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.42.1...1.42.2)

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

Updates `quote` from 1.0.38 to 1.0.39
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.38...1.0.39)

Updates `ref-cast` from 1.0.23 to 1.0.24
- [Release notes](https://github.com/dtolnay/ref-cast/releases)
- [Commits](https://github.com/dtolnay/ref-cast/compare/1.0.23...1.0.24)

Updates `serde_json` from 1.0.139 to 1.0.140
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.139...v1.0.140)

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

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

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: async-trait
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: insta
  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: quote
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: ref-cast
  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
- 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>
2025-03-03 18:19:47 +00:00
dependabot[bot]
1cd16874aa 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.49.8 to 2.49.10
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](dccf3df6e0...3c8fc6eaa5)

Updates `astral-sh/setup-uv` from 5.3.0 to 5.3.1
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](1edb52594c...f94ec6bedd)

---
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-03-03 18:18:56 +00:00
Benjamin Tan
ea8e4ac771 cli_util: extract shared compute_commit_location function
This will be used to compute the location to place commits from the
`--destination`, `--insert-after`, and `--insert-before` options. This
is used across the `new`, `duplicate`, and `rebase` commands, and can be
used for further commands as well.
2025-03-03 14:56:32 +00:00
Benjamin Tan
48b850b3a5 cli: new: --insert-after: remove special handling of commits which are ancestors
The previous implementation of `new --insert-after` excluded children
that were ancestors of the new commit. This was done to avoid creating
cycles in the commit graph. However, this does not align with the
behavior of the `--insert-after` in the other commands, which explicitly
error if inserting a new commit after the given `--insert-after` commits
would create a cycle.

For consistency, and given that the desired behavior can be achieved
using by using `--insert-after` along with `--insert-before`, this
behavior is removed.
2025-03-03 14:56:32 +00:00
Yuya Nishihara
7e8dba8d94 op_store: validate operation/view id length to detect corruption earlier
After system crash, file contents are often truncated or filled with zeros. If
a file was truncated to empty, it can be decoded successfully and we'll get
cryptic "is a directory" error because of an empty view ID. We should instead
report data corruption with the ID of the corrupted file.

#4423
2025-03-03 01:18:34 +00:00
Yuya Nishihara
2eb6a0198b op_store: remove redundant DecodeError type
It should be equivalent to OpStoreError::ReadObject. Perhaps, we couldn't use
ReadObject before because the source error type wasn't dyn Error.
2025-03-03 01:18:34 +00:00
Yuya Nishihara
6261d576da git: use gix::ObjectId::from_bytes_or_panic() consistently 2025-03-02 02:19:00 +00:00
Burak Varlı
7b52ff51f0 cli git fetch: support string pattern syntax in remote option
Signed-off-by: Burak Varlı <unexge@gmail.com>
2025-03-01 12:11:19 +00:00
Baltasar Dinis
038da961c0 cli/tests: move test_git_colocated_unborn_bookmarks to gitoxide 2025-03-01 09:54:31 +00:00
Baltasar Dinis
071e724c1c cli/tests: move test_git_colocated_fetch_deleted_or_moved_bookmark to gitoxide 2025-03-01 09:54:31 +00:00
Baltasar Dinis
05479df69e cli/tests: move most of the test_git_colocated tests to gitoxide 2025-03-01 09:54:31 +00:00
pylbrecht
7b229e6b97 sign: format link in help
Following the existing conventions for formatting links.
2025-03-01 07:31:55 +00:00
pylbrecht
0e498c7dcb sign: link to docs in jj sign and jj unsign 2025-03-01 07:31:55 +00:00
Evan Mesterhazy
2af5b60d32 cli split: Disable the new bookmark behavior for jj split
The consensus about this change, if one ever existed, seems to have dissolved
into two cohorts, one which is happy with the change, and one which thinks we
should move both the bookmark and change id to the child commit instead of
leaving them on the parent.

We may decide to add flags to allow users to choose between the two behaviors,
but there are also other concerns such as where @ should go (parent or child).
Until we agree on a path forward it seems reasonable to delay the breaking
change by disabling it via the config option we added. I don't think it's
necessary to fully revert the code and new tests since we aren't announcing the
option.


#3419
2025-02-28 23:23:06 +00:00
dependabot[bot]
8a6bfc9ee9 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.7 to 2.49.8
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](ada1a57be8...dccf3df6e0)

---
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-02-28 17:59:06 +00:00
Evan Mesterhazy
8046ecefba cli split: Rename the "commit" variable to "target_commit"
This has bothered me for a while... It's useful to describe the target of the
split command as the "target commit", and it's a little confusing to have a
variable named "commit" in the code when we are dealing with several different
commits in the command.

I think this improves readability by being more precise.
2025-02-28 12:15:31 +00:00
Yuya Nishihara
63f874376c tests: make git::IndexManager::new() preserve the staged changes
It's odd that IndexManager::new(repo) creates a new empty index ignoring the
current state. The callers appear not to depend on this behavior.
2025-02-28 11:19:46 +00:00
Yuya Nishihara
2586ec5b75 tests: remove unused field from git::IndexManager 2025-02-28 11:19:46 +00:00
pylbrecht
e5ca254084 sign: add --key argument to jj sign
Following up on #4747 (see
https://github.com/jj-vcs/jj/pull/4747#discussion_r1968720554).
2025-02-28 07:52:57 +00:00
pylbrecht
7bf4148169 commit_builder: split set_sign_key()
Clearing a sign key would require calling `set_sign_key(None)`, which
makes the API slightly awkward.

Instead, we introduce `clear_sign_key()` and make `set_sign_key()` only
accept a `String`. This makes clearing the sign key explicit.

Co-Authored-By: Yuya Nishihara <yuya@tcha.org>
2025-02-28 07:52:57 +00:00
Yuya Nishihara
b15769448b cli: provide better hint on bookmark name parse error
It should be better to say parsing failed, rather than starting with detailed
pest error message.
2025-02-28 07:27:40 +00:00
Yuya Nishihara
72b24d18e3 revset: box RevsetParseErrorKind to keep error type small
RevsetParseErrorKind has variants containing 3 String fields, which ends up 80
bytes.
2025-02-28 07:27:40 +00:00
Yuya Nishihara
0b56863aed revset: export low-level parse_program() function
This is useful to check if an input text can be parsed as a revset expression.
2025-02-28 07:27:40 +00:00
Yuya Nishihara
539f242e6c cli: print error sources if clap cannot parse arguments
Bookmark name error will be nested in order to provide a better error hint.
2025-02-28 07:27:40 +00:00
pylbrecht
c90f0b96a4 sign: add default revisions for jj sign
When signing commits with `jj sign`, one might want to use a workflow
like:

```bash
jj fix && jj sign .. && jj git push
```

Making the default value for `-r`/`--revisions` configurable, will allow
such a workflow.

Co-Authored-By: Yuya Nishihara <yuya@tcha.org>
2025-02-28 07:14:59 +00:00
Aleksey Kuznetsov
cfcd034879 docs: Add pointers to usage of jj help -k <keyword>
Relates to #5306
2025-02-28 06:52:52 +00:00
Yuya Nishihara
6c597d962d git: on reset_head(), check if the actual HEAD points to known location
This will probably mitigate problems of concurrent updates. If two concurrent
processes tried to import + reset HEAD, one of them should fail.

Closes #3754
2025-02-28 05:45:29 +00:00
Baltasar Dinis
e9e127c233 lib/tests: move remaining git test to gitoxide 2025-02-28 03:58:46 +00:00
dependabot[bot]
e22469d6c9 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.5 to 2.49.7
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](019e221005...ada1a57be8)

---
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-02-27 18:39:56 +00:00
Ilya Grigoriev
f399c57466 docs workflow: try to fix it a third time
I think I likely found the issue. zizmor seems OK
with persisting credentials, see
https://github.com/jj-vcs/jj/actions/runs/13559693565/job/37900455060?pr=5820

Both of these workflows run only on commits in `main`,
so this doesn't seem like a huge security hole, but
we could consider other, better solutions in the
future.

Follow up to 78177ff. See #5819 for a failed attempt.
cc @thoughtpolice @neongreen @martinvonz
2025-02-27 06:32:04 +00:00
Ilya Grigoriev
78177ff69e docs workflow: try to fix it again
It's been broken since 514a009. Since 0e2d079,
the error was:

```
error: failed to push branch gh-pages to origin:
"fatal: could not read Username for 'https://github.com': No such device or address"
```

This is hard to test outside of prod, but follows a guess after
reading some Github docs and `gh auth login` docs from
<https://cli.github.com/manual/gh_auth_login>. I could not
find docs specifically about using the `git` CLI, but I'm guessing
that if `gh auth login` makes `git push` work on user machines by
setting `GH_TOKEN`, doing the same might help.

🤞

Cc @thoughtpolice, @martinvonz
2025-02-27 05:07:12 +00:00
dependabot[bot]
e30a617428 cargo: bump chrono from 0.4.39 to 0.4.40 in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [chrono](https://github.com/chronotope/chrono).


Updates `chrono` from 0.4.39 to 0.4.40
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.39...v0.4.40)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-26 16:11:17 +00:00
dependabot[bot]
83e943de7b 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.4 to 2.49.5
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](6c595e9f7b...019e221005)

---
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-02-26 16:10:45 +00:00
Yuya Nishihara
ae8e6e8e8e view: port remote_bookmark accessors to RemoteRefSymbol 2025-02-26 03:17:45 +00:00
Yuya Nishihara
4b06274785 view: make remote bookmark iterators yield RemoteRefSymbol instead of tuple
This also changes formatting of remote symbol to use revset compatible form.
2025-02-26 03:17:45 +00:00
Yuya Nishihara
6c71f3cbf2 git: use RemoteRefSymbolBuf to represent RefName::RemoteBranch variant
This also changes the formatting to use revset compatible form.
2025-02-26 03:17:45 +00:00
Yuya Nishihara
c63a7fa4d2 cli: bookmark: replace RemoteBookmarkName with RemoteRefSymbol
Now remote bookmark names are printed in revset compatible form.
2025-02-26 03:17:45 +00:00