8712 Commits

Author SHA1 Message Date
Yuya Nishihara
d4023d873d git: instantiate GitSubprocessContext by push_updates() for consistency 2025-02-01 11:04:38 +00:00
Yuya Nishihara
8cad3ac95a git: extract GitFetchImpl that holds implementation-specific objects
This could be a trait object, but we only need a single fetch() function per
implementation.
2025-02-01 11:04:38 +00:00
Yuya Nishihara
6e3c7fcf2d git: extract inner fetch functions out of GitFetch struct
I'm going to add enum that holds either git2::Repository or subprocess context.
"&mut self" will be useless there.
2025-02-01 11:04:38 +00:00
Yuya Nishihara
658cd3e0fd git: resolve git2::Repository internally in GitFetch::new()
git2::Repository will be removed from the subprocess code path.
2025-02-01 11:04:38 +00:00
Yuya Nishihara
9bf29accc2 git: resolve git2::Repository internally in push_updates()
git2::Repository will be removed from the subprocess code path.
2025-02-01 11:04:38 +00:00
Yuya Nishihara
fd76b44d55 cli: transform GitFetch/PushError globally 2025-02-01 11:04:38 +00:00
Yuya Nishihara
27e7672a3b git: store bad pattern object in GitFetchError::InvalidBranchPattern
This helps add From<GitFetchError> impl.
2025-02-01 11:04:38 +00:00
Jakob Hellermann
d212becdba cli: complete: use null Ui to prevent writing warnings into completions
E.g. when the user doesn't have the default command set, you don't want
to get
```
Warning: Cannot define an alias that overrides the built-in command 'log'
```
printed on every completion.
2025-02-01 08:37:22 +00:00
Jakob Hellermann
d7c887c424 cli: add ability to construct null Ui without any output 2025-02-01 08:37:22 +00:00
dependabot[bot]
e554533792 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.31 to 2.47.32
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](76a1fec160...65835784ac)

---
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-01 04:00:26 +00:00
dependabot[bot]
48dea149a5 cargo: bump toml_edit in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [toml_edit](https://github.com/toml-rs/toml).


Updates `toml_edit` from 0.22.22 to 0.22.23
- [Commits](https://github.com/toml-rs/toml/compare/v0.22.22...v0.22.23)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-01 04:00:22 +00:00
Yuya Nishihara
67bb2809ed git: test that local progress is emitted through callback 2025-02-01 03:30:39 +00:00
Baltasar Dinis
b35d503bf7 git: show fetch progress with git.subprocess = true 2025-02-01 01:46:31 +00:00
Yuya Nishihara
994c6a457a cli: remove handling of null terminated string from git sideband writer
I think this is copy-paste error from C implementation.
2025-02-01 00:41:51 +00:00
Yuya Nishihara
fc82e99ae9 cli: move cursor to first column after printing git progress bar
This helps sideband writer overwrite the progress bar. Suppose progress
information is less important than sideband messages, it should be okay to
always overwrite the progress bar. The sideband writer will erase the trailing
characters and move the cursor back to the first column, and/or put "\n"
accordingly.
2025-02-01 00:41:51 +00:00
Scott Taylor
66808e5dc1 conflicts: use clearer wording for missing newline comment
The current comment uses `[noeol]`, which can be difficult to
understand. In this commit, the brackets are changed to parentheses to
make it clear that there is no semantic meaning to the comment, and the
wording is changed to be more clear to the user.
2025-01-31 23:38:42 +00:00
Scott Taylor
0b719332aa conflicts: don't mark missing newline in Git-style conflicts
Git doesn't show this information in their "diff3" style either, and it
looks a bit strange having two different bracketed sections of text next
to each other, so I think it would be better to remove it.
2025-01-31 23:38:42 +00:00
Antoine Martin
c2acc49be5 docs: document the ui.movement.edit config option
This option was introduced in #4283, but was not documented apart from
`prev` and `next`'s help text on the --edit/--no-edit flags.
2025-01-31 23:10:34 +00:00
Martin von Zweigbergk
4ac970fcc5 cleanup: prefer MutableRepo::repo() over repo_mut()
When we don't need a mutable reference, we should be using `repo()`.
2025-01-31 18:03:01 +00:00
Martin von Zweigbergk
0f1a6fc4ae rebase: clarify -d/-A/-B arguments with examples 2025-01-31 16:08:15 +00:00
Martin von Zweigbergk
0d00de72c6 cli: git: escape bookmark and remote names in trunk() config
Closes #5359.
2025-01-31 15:54:47 +00:00
Martin von Zweigbergk
ef20b7b7ab revset: add a function for escaping a symbol
When we have e.g. a bookmark name or a remote name and we want to
produce a revset from it, we may need to quote and escape it. This
patch implements a function for that.

Perhaps we'll want to more generally be able to format a whole
`RevsetExpression` later.
2025-01-31 15:54:47 +00:00
Martin von Zweigbergk
b1827e16f1 cli: tests: fix a bad copy&paste 2025-01-31 15:54:47 +00:00
Yuya Nishihara
b637e98127 git: enable sideband message callback globally, disable on fetch without tty
With this and "git --progress" PR #5519, remote git progress will be displayed.

The sideband callback is disabled in git2 code path if progress is not enabled.
If this were enabled, most "git fetch" tests would fail with git2 due to remote
progress messages. Since there's no git2 API to turn the remote progress off,
and the git2 code path is supposed to be phased out, I just inserted ad-hoc
workaround.
2025-01-31 01:47:34 +00:00
Yuya Nishihara
4dd9c5f0a7 git: simplify cast of progress callback 2025-01-31 01:47:34 +00:00
Yuya Nishihara
cdbfd6bc51 git: reimplement get_all_remotes() by using gix API 2025-01-31 00:52:23 +00:00
Yuya Nishihara
7a1cd6a0f6 git: factor out common get_git_backend/repo() helper, simplify error handling 2025-01-31 00:52:23 +00:00
Martin von Zweigbergk
faa689a736 contributing.md: describe how to configure jj fix to run rustfmt 2025-01-30 19:14:43 +00:00
dependabot[bot]
d620ef95d1 github: bump the github-dependencies group with 3 updates
Bumps the github-dependencies group with 3 updates: [taiki-e/install-action](https://github.com/taiki-e/install-action), [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `taiki-e/install-action` from 2.47.30 to 2.47.31
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](afbe5c1715...76a1fec160)

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

Updates `github/codeql-action` from 3.28.7 to 3.28.8
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](6e54559041...dd746615b3)

---
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
- 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-01-30 16:26:12 +00:00
dependabot[bot]
6ee7525add cargo: bump clap_complete in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [clap_complete](https://github.com/clap-rs/clap).


Updates `clap_complete` from 4.5.43 to 4.5.44
- [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.43...clap_complete-v4.5.44)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-30 16:25:42 +00:00
Yuya Nishihara
d3f56c0acd git: forward "remote: " lines when they arrive
This patch adds thread-based implementation. On Unix, we can poll pipes without
using thread, but I don't think platform-dependent optimization is needed.
2025-01-30 07:06:42 +00:00
Scott Taylor
95df920070 docs: explain [noeol] conflict marker comment
The meaning of `[noeol]` might not be immediately clear to a user, so it
would be good to document it on our documentation page for conflicts. We
may also want to improve the conflict marker comments we use for this
case in the future (possibly after receiving user feedback).
2025-01-29 23:49:02 +00:00
Jakob Hellermann
3293a1aa97 cli: completion: derive clap::ValueEnum for ColorChoice
This enables autocompletion for `jj --color <TAB>`
2025-01-29 22:51:24 +00:00
Austin Seipp
a4fa4b6dbd github: replace some exact conditionals with prefix matches
This will be more robust long term since e.g. native ARM runners use
`ubuntu-24.04-arm` as their runner image, and the version number really
isn't a big deal in this case.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-01-29 22:13:19 +00:00
Josh Steadmon
fb4d796cc6 docs: point to jj-vcs for Nix install instructions 2025-01-29 22:03:16 +00:00
dependabot[bot]
c850ddf289 github: bump the github-dependencies group across 1 directory with 3 updates
Bumps the github-dependencies group with 3 updates in the / directory: [taiki-e/install-action](https://github.com/taiki-e/install-action), [actions/setup-python](https://github.com/actions/setup-python) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `taiki-e/install-action` from 2.47.25 to 2.47.30
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](1936c8cfe3...afbe5c1715)

Updates `actions/setup-python` from 5.3.0 to 5.4.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](0b93645e9f...42375524e2)

Updates `github/codeql-action` from 3.28.5 to 3.28.7
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](f6091c0113...6e54559041)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
  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-01-29 20:50:25 +00:00
dependabot[bot]
a9333287ee 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 [tempfile](https://github.com/Stebalien/tempfile).


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

Updates `tempfile` from 3.15.0 to 3.16.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.15.0...v3.16.0)

---
updated-dependencies:
- dependency-name: serde_json
  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>
2025-01-29 20:50:06 +00:00
Austin Seipp
6f1d15bd1a nix: build flake checks in test profile
Overall, building in the test profile should significantly speed up
the overall build pipeline because so many less cycles are spent (on
GHA runners that are certainly at high load). The goal here is to help
reduce CI flake outs due to things timing out; I suspect part of the
problem may be a lot of the ~15 minute time limit being used up just
compiling things.

This is a partial revert of b714592952400ab, which removed this previous
override of the Flake `checks`.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-01-29 20:30:58 +00:00
Austin Seipp
1473c0cd4f nix: split rust toolchains used for shell/CI
This should help reduce time spent on closure downloads.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-01-29 20:30:58 +00:00
Austin Seipp
1b0f95910b github: track slow tests in CI builds
Some of our builds have been timing out, and one angle I want to look at
is whether any tests are hanging. Nextest can help us keep track of slow
tests in CI where the underlying hosts will have significantly higher
load. In general this should also help keep our tests healthy, IMO.

I don't see any reason why any existing test should take over 20
seconds, but it should at least help control for really slow runners
that have huge latency spikes. we can start there and see how it goes
in practice.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-01-29 20:30:58 +00:00
Matt Kulukundis
5b5a9e71c3 docs: improve cli docs for consistency and links 2025-01-29 18:01:16 +00:00
Baltasar Dinis
120b9cc766 git: forward remote messages to output 2025-01-28 21:56:04 +00:00
Baltasar Dinis
e8620c31ae git: describe codepaths that require git2 2025-01-28 18:29:01 +00:00
Baltasar Dinis
eb1d70317a cli: relocate git fetch code to cli/src/commands/git/fetch.rs
This code was living in cli/src/git_utils.rs but no one else was using
it
2025-01-28 18:29:01 +00:00
Baltasar Dinis
1be574c219 git: update jj git clone|fetch to use new GitFetch api directly.
* Make the new `GitFetch` api public.
* Move `git::fetch` to `lib/tests/test_git.rs` as `git_fetch`, to minimize
  churn in the tests. Update test call sites to use `git_fetch`
* Delete the `git::fetch` from `lib/src/git.rs`.
* Update `jj git clone` and `git_fetch` in `cli/src/git_utils.rs` to use
  the new api directly. Removing one redundant layer of indirection.
* This fixes #4920 as it first fetches from all remotes before `import_refs()`
  is called, so there is no race condition if the same commit is treated
  differently in different remotes specified in the same command.

Original commit by @essiene
2025-01-28 18:29:01 +00:00
Baltasar Dinis
2f8bbb111a tests: refactor cli tests for git 2025-01-28 18:29:01 +00:00
Jonathan Frere
11fbbf6ad4 docs: fix typo in templating language example 2025-01-28 17:42:12 +00:00
Yuya Nishihara
90e79348e3 diff: remove ad-hoc rename handling in show_diff_stat()
Renamed entries are omitted by iterator/stream since 352a4a0eea8e "copies:
filter rename source entries by CopiesTreeDiffStream."
2025-01-28 01:44:57 +00:00
Ilya Grigoriev
c5e30f9f30 codespell action: use uv to run codespell
The primary goal is to control the version of the `codespell` Python
package that we run via `uv.lock`. See also
https://github.com/jj-vcs/jj/pull/5425.

Also move the action next to the `cargo fmt` action. It might make sense
to split both of them out of `build.yml` if it gets too long, but I
think they should be next to each other since they are so similar in
spirit.
2025-01-28 00:52:17 +00:00
Ilya Grigoriev
f4346f2e51 cli reference & jj log --help: render URLs in CLI refrerence
Fixes #5490 (we can catch other instances of this manually)

Note that it links to the `latest` even if you are looking at the
`prerelease` docs. This is not ideal, but seems annoying to fix.
2025-01-28 00:50:54 +00:00