Martin von Zweigbergk
a01d0bf773
cli: resolve: leave executable bit unchanged when using external tool
...
`jj resolve` will currently try to resolve the executable bit and will
clear it if it can't be resolved. I don't think the executable bit
should be affected by the external merge tool. We could preset the
flags on the files we pass to the merge tool and then expect the merge
tool to update the flags, but we don't do that. I'm not sure that's a
good idea (few merge tools probably expect that), but since we don't
do it, I think it's better to leave the executable bits
unchanged. This patch makes it so by calling
`Merge::with_new_file_ids()` on the original conflict whether or not
the content-level conflict was resolved.
I noticed this was while working on the copy-tracking proposal in PR
#4988 , which involves adding copy information in the `TreeValue`. If
we do implement that, then we should preserve copy information here
too (in addition to the executable flag). That will automatically work
after this patch.
2025-03-12 04:15:17 +00:00
Martin von Zweigbergk
9fe2075650
cli: chmod: update TreeValues in place
...
If we add copy info to `TreeValue::File`, we will want to preserve
that when the user runs `jj chmod`. It's easier to preserve it by
updating the `Merge<Option<TreeValue>>` in place, so that's what this
patch does.
2025-03-12 04:15:17 +00:00
Ilya Grigoriev
2f97d4a3d8
cli clone
and init
: remove unhelpful parts of clap error
...
We could replace clap's "SuggestedSubcommand" instead of removing it,
but then the user might not notice that this is a custom suggestion and
not pay enough attention to it.
This uses the just-released https://github.com/clap-rs/clap/pull/5941 .
2025-03-12 04:02:52 +00:00
Ilya Grigoriev
2bb8775c44
cli clone
and init
: color test for the error message
...
There are alternative ways to solving the problem addressed by the next
commit, but they don't seem to preserve color well. So, let's have a
test to make sure future refactorings can tell whether this issue is
still relevant.
2025-03-12 04:02:52 +00:00
Ilya Grigoriev
c38e316a91
cli op diff
: show changes to the working copy positions
...
I find this useful for debugging what happened sometimes,
e.g. after some concurrent operations mess.
2025-03-12 03:41:27 +00:00
Ilya Grigoriev
270924ddaa
lib: new diff_named_commit_ids
helper
2025-03-12 03:41:27 +00:00
Ilya Grigoriev
ca46ce1d3a
view: store working copies in BTreeMap
...
This is analogous to how bookmarks are stored and simplifies the
following commit.
2025-03-12 03:41:27 +00:00
Ilya Grigoriev
7d7a2fa390
cli string patterns: explain case-insensitive string prefixes
...
Before reading the docs, my instinct was to try `iglob:` instead of the
correct `glob-i:`.
2025-03-12 03:09:03 +00:00
Yuya Nishihara
e054a291b1
git: use translated remote symbols in import_refs()
...
This removes the special case for RefName::LocalBranch(_), which can be
processed as a remote bookmark.
"jj git import" now prints local bookmarks and tags with @git suffix. I think
this is more correct since these refs are imported from the backing Git
repository.
2025-03-12 02:20:00 +00:00
Yuya Nishihara
540ae1b697
git: pass remote (kind, symbol) parameters to git_ref_filter()
...
I'll reimplement import/export internals to be based off the translated remote
symbols.
2025-03-12 02:20:00 +00:00
Yuya Nishihara
78361eb4f8
cli: deduplicate RefKind types
...
They're identical except for naming.
2025-03-12 02:20:00 +00:00
Yuya Nishihara
907b20162f
git: extract function that parses git ref to remote symbol
...
The old parse_git_ref() function and RefName type will be removed.
2025-03-12 02:20:00 +00:00
Yuya Nishihara
d8ae6dc8c9
tests: port test_bookmark_command.rs to TestWorkDir API
2025-03-12 02:18:56 +00:00
Yuya Nishihara
8fc6dea310
tests: port test_backout_command.rs to TestWorkDir API
2025-03-12 02:18:56 +00:00
Yuya Nishihara
b87a50783d
tests: port test_alias.rs to TestWorkDir API
2025-03-12 02:18:56 +00:00
Yuya Nishihara
a68620a803
tests: port test_advance_bookmarks.rs to TestWorkDir API
2025-03-12 02:18:56 +00:00
Yuya Nishihara
76e9342bbb
tests: port test_acls.rs to TestWorkDir API
2025-03-12 02:18:56 +00:00
Yuya Nishihara
d5d4c7fe79
tests: port test_absorb_command.rs to TestWorkDir API, add read_file() helper
...
read_file() returns BString as it implements Display.
2025-03-12 02:18:56 +00:00
Lucas Garron
4e22902249
Replace the PNG logo with a vector SVG version.
...
This version is significantly smaller and crisp at any resolution.
Update docs/index.md
2025-03-11 22:44:13 +00:00
dependabot[bot]
e72a85599f
cargo: bump the cargo-dependencies group with 5 updates
...
Bumps the cargo-dependencies group with 5 updates:
| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap ) | `4.5.31` | `4.5.32` |
| [indexmap](https://github.com/indexmap-rs/indexmap ) | `2.7.1` | `2.8.0` |
| [libc](https://github.com/rust-lang/libc ) | `0.2.170` | `0.2.171` |
| [once_cell](https://github.com/matklad/once_cell ) | `1.20.3` | `1.21.0` |
| [rustix](https://github.com/bytecodealliance/rustix ) | `1.0.1` | `1.0.2` |
Updates `clap` from 4.5.31 to 4.5.32
- [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/v4.5.31...clap_complete-v4.5.32 )
Updates `indexmap` from 2.7.1 to 2.8.0
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/main/RELEASES.md )
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.7.1...2.8.0 )
Updates `libc` from 0.2.170 to 0.2.171
- [Release notes](https://github.com/rust-lang/libc/releases )
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.171/CHANGELOG.md )
- [Commits](https://github.com/rust-lang/libc/compare/0.2.170...0.2.171 )
Updates `once_cell` from 1.20.3 to 1.21.0
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md )
- [Commits](https://github.com/matklad/once_cell/compare/v1.20.3...v1.21.0 )
Updates `rustix` from 1.0.1 to 1.0.2
- [Release notes](https://github.com/bytecodealliance/rustix/releases )
- [Changelog](https://github.com/bytecodealliance/rustix/blob/main/CHANGES.md )
- [Commits](https://github.com/bytecodealliance/rustix/compare/v1.0.1...v1.0.2 )
---
updated-dependencies:
- dependency-name: clap
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
- dependency-name: libc
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: cargo-dependencies
- dependency-name: once_cell
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: cargo-dependencies
- dependency-name: rustix
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: cargo-dependencies
...
Signed-off-by: dependabot[bot] <support@github.com>
2025-03-11 18:52:35 +00:00
Martin von Zweigbergk
fe846d69d4
faq: in entry about default jj log
revset, explain rationale
...
The FAQ entry explaining why `jj log` doesn't show all commits
explained that the behavior is configurable but it didn't explain what
the rationale for not showing all commits is. Users coming from Git
are used to seeing all commits and probably read this FAQ entry to
find an answer. We don't want them to just update their config without
understanding why we have the default we have.
2025-03-11 17:55:32 +00:00
Yuya Nishihara
d37a5b1b74
fileset, revset: settle on optionally-quoted pattern syntax
...
Suppose revsets and filesets are primarily used in command shell, it would be
annoying if quoting is required in addition to the shell quoting. We might also
want to relax the revset parser to allow bare * in glob string.
Closes #2101
2025-03-11 08:35:27 +00:00
Martin von Zweigbergk
dc7216d73a
cli: diff: support multiple revisions to -r
2025-03-11 06:27:51 +00:00
Emily
f862d89143
git: port Git state clean‐up from git2
2025-03-11 03:09:13 +00:00
Emily
185a09b9ca
git: add test for Git state clean‐up
2025-03-11 03:09:13 +00:00
Ilya Grigoriev
09426ac222
cli fileset errors: insert link to docs
2025-03-11 03:00:58 +00:00
Ilya Grigoriev
bc06e66313
fileset docs: edits to quoting and file pattern instructions
...
- Swapped `file:"path"` and `cwd-file:"path"` for consistency with the first line
- Created a labeled section for quoting rules
- Elaborated on the quoting rules in the beginning of file pattern section.
2025-03-11 03:00:58 +00:00
Emily
fe9e71b90e
git: remove .gitmodules
parsing code
...
This is redundant with `gix`’s native API and not used by anything
but a hidden debugging command.
2025-03-11 02:37:13 +00:00
Yuya Nishihara
1a8d2f5195
tests: use TestWorkDir in test_abandon_command.rs
2025-03-11 01:23:13 +00:00
Yuya Nishihara
e802c4b8fe
tests: move current_operation_id() to TestWorkDir
2025-03-11 01:23:13 +00:00
Yuya Nishihara
61a449554b
tests: pass &TestWorkDir to create_commit*() helper
...
Callers will be ported to TestWorkDir API separately.
2025-03-11 01:23:13 +00:00
Jo Liss
4e3f43c261
docs: explain that jj root
is synonymous with jj workspace root
2025-03-10 21:44:06 +00:00
Emily
b2d63189b9
git: use try_collect
2025-03-10 21:22:42 +00:00
dependabot[bot]
9a15ce5fbd
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.16 to 2.49.19
- [Release notes](https://github.com/taiki-e/install-action/releases )
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md )
- [Commits](1426bdb9e2...87b5304d4e
)
Updates `EmbarkStudios/cargo-deny-action` from 2.0.10 to 2.0.11
- [Release notes](https://github.com/embarkstudios/cargo-deny-action/releases )
- [Commits](4de59db63a...34899fc7ba
)
---
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-10 17:34:36 +00:00
dependabot[bot]
517d647091
cargo: bump the cargo-dependencies group with 3 updates
...
Bumps the cargo-dependencies group with 3 updates: [rustix](https://github.com/bytecodealliance/rustix ), [serde](https://github.com/serde-rs/serde ) and [syn](https://github.com/dtolnay/syn ).
Updates `rustix` from 0.38.44 to 1.0.1
- [Release notes](https://github.com/bytecodealliance/rustix/releases )
- [Changelog](https://github.com/bytecodealliance/rustix/blob/main/CHANGES.md )
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.44...v1.0.1 )
Updates `serde` from 1.0.218 to 1.0.219
- [Release notes](https://github.com/serde-rs/serde/releases )
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.218...v1.0.219 )
Updates `syn` from 2.0.99 to 2.0.100
- [Release notes](https://github.com/dtolnay/syn/releases )
- [Commits](https://github.com/dtolnay/syn/compare/2.0.99...2.0.100 )
---
updated-dependencies:
- dependency-name: rustix
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: cargo-dependencies
- dependency-name: serde
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
...
Signed-off-by: dependabot[bot] <support@github.com>
2025-03-10 17:33:43 +00:00
demize
c3cc3de818
git: clean up remove_remote_git_config_sections
2025-03-10 15:08:38 +00:00
demize
cf696ce1b6
git: update gitoxide
repository options
...
This fixes tests in --release and provides safer
defaults.
2025-03-10 15:08:38 +00:00
Emily
eeb34146ca
tests: remove libgit2
test performance hack
...
I think we should only initialize the library for the fetch/push
tests now, so it should be okay to drop this.
2025-03-10 15:08:08 +00:00
Emily
ad35f865ed
git_backend: remove obsolete libgit2
workaround
2025-03-10 15:07:46 +00:00
Caleb White
072af8448f
cli: bookmark move: allow short aliases for --to
/--from
...
If `--to` is going to become a required argument, it should
have a short alias as it will be used quite frequently.
Given that `--to` has a short alias it only makes sense to
allow `-f` for `--from` as this is consistent with other
commands and nothing makes this particular command special.
2025-03-10 13:02:08 +00:00
Yuya Nishihara
16028245d6
tests: add workspace test helper, use it in test_global_opts.rs
...
It's super common to pair test_env with repo_path.
Some of the tests still use absolute paths because it seemed rather confusing
to mix paths relative to the repo_root and to the env_root.
2025-03-10 07:50:18 +00:00
Martin von Zweigbergk
5f8654ef68
revset: remove unused lifetime parameter from RevsetIteratorExt
...
It became unused in 75605e36.
2025-03-10 07:49:59 +00:00
Yuya Nishihara
c0066083ad
git: make import of refs/remotes/git/* non-error, warn failed refs instead
...
I'm going to reimplement git_ref_filter to process translated remote bookmark
names, and "git" remote will mean the local Git-tracking remote there. The
reserved remote name is checked prior to filtering because refs in that remote
cannot be represented as remote symbols.
I originally implemented the error handling the other way because we didn't
have a machinery to report partial import failure. Now we have stats, it's
easy to report skipped ref names.
2025-03-10 02:04:33 +00:00
Yuya Nishihara
cc1b716d39
git: plumbing to report unimportable refs, warn non-utf-8 names
...
Tests will be added by the next patch. It's not important to report non-utf-8
refs, but this patch implements it as doing that was easy.
2025-03-10 02:04:33 +00:00
Emily
fd7f1f558e
cli: remove git_util::get_git_repo
...
No longer used by anything.
2025-03-09 21:17:10 +00:00
Emily
2e0bdd3396
cli: use gix
in maybe_set_repository_level_trunk_alias
2025-03-09 21:17:10 +00:00
Emily
8297938feb
git: port remote management to gix
2025-03-09 21:17:10 +00:00
Emily
09f6cafa2b
git: add remote management tests
2025-03-09 21:17:10 +00:00
Emily
c25aa6e417
git: abstract git2
in remote management API
...
This is more consistent with other similar APIs and minimizes churn
in the test code as we move these to `gix`.
2025-03-09 21:17:10 +00:00
Yuya Nishihara
3318d172ff
cli: bookmark: scan deleted local bookmarks in separate loop
...
We no longer have to do multiple things in one loop.
2025-03-09 09:33:07 +00:00