2559 Commits

Author SHA1 Message Date
Emily
370c624518 tests: add TestEnvironment::with_git_subprocess helper 2025-04-04 09:50:20 +00:00
Emily
350da7d013 cargo: bump gix to 0.71.0
Fix GHSA-794x-2rpg-rfgr.

`gix::Repository::work_dir` was renamed to `workdir` (though strangely
not the `gix::ThreadSafeRepository` version), and `lossy_config`
is now off by default in all configurations.
2025-04-04 04:28:42 +00:00
Emily
c488a4030f tests: fix subprocess toggle in git push --named tests 2025-04-04 03:02:01 +00:00
Yuya Nishihara
a027f8f659 tests: port test_workspaces.rs to TestWorkDir API 2025-04-04 01:48:39 +00:00
Yuya Nishihara
147b181368 tests: port test_working_copy.rs to TestWorkDir API 2025-04-04 01:48:39 +00:00
Yuya Nishihara
37fd0f1256 tests: port test_util_command.rs to TestWorkDir API 2025-04-04 01:48:39 +00:00
Yuya Nishihara
1e5d33beab tests: port test_undo.rs to TestWorkDir API 2025-04-04 01:48:39 +00:00
Yuya Nishihara
0ada5bd868 tests: port test_templater.rs to TestWorkDir API 2025-04-04 01:48:39 +00:00
Yuya Nishihara
8d8b760299 tests: port test_tag_command.rs to TestWorkDir API 2025-04-04 01:48:39 +00:00
Yuya Nishihara
16c788aac5 tests: port test_status_command.rs to TestWorkDir API 2025-04-04 01:48:39 +00:00
Scott Taylor
12add9b35e merge_tools: fix :ours and :theirs merge tools
These merge tools didn't work properly on conflicted trees with more
than two sides since they didn't simplify the conflict before resolving.
The new implementation is more similar to how external merge tools are
executed, which should give a more consistent behavior.
2025-04-04 01:38:33 +00:00
Scott Taylor
a7b112ecb8 merge_tools: rename content to simplified_file_content
This makes it more clear that this is the only field in `MergeToolFile`
which is simplified.
2025-04-04 01:38:33 +00:00
Scott Taylor
466d237a06 merge_tools: demo issue with :ours and :theirs 2025-04-04 01:38:33 +00:00
Emily
71a619c19f tests: don’t use git2 in testutils 2025-04-03 19:03:44 +00:00
Yuya Nishihara
0bcdedc159 tests: add missing insta::allow_duplicates! { .. }
Fixes #6230
2025-04-03 15:42:07 +00:00
Ilya Grigoriev
fa0b901c07 cli external merge tools: add tracing when reparsing conflicts
I was trying to debug `mergiraf` behavior, and having such diagnostic
would have been helpful.
2025-04-03 02:11:21 +00:00
Yuya Nishihara
ea6a768517 tests: port test_squash_command.rs to TestWorkDir API 2025-04-03 01:43:02 +00:00
Yuya Nishihara
87a35d5bb2 tests: port test_split_command.rs to TestWorkDir API 2025-04-03 01:43:02 +00:00
Yuya Nishihara
f2ca6b7740 tests: set up fake editor early in test_{split,squash}_command.rs
This helps avoid borrowing issue.
2025-04-03 01:43:02 +00:00
Yuya Nishihara
4faf07c872 tests: port test_sparse_command.rs to TestWorkDir API 2025-04-03 01:43:02 +00:00
Yuya Nishihara
87a78b6953 tests: port test_simplify_parents_command.rs to TestWorkDir API 2025-04-03 01:43:02 +00:00
Yuya Nishihara
3ce077de61 tests: inline create_repo() to callers in test_simplify_parents_command.rs
TestWorkDir will have to be borrowed from TestEnvironment, and the remaining
codes would be just "git init repo".
2025-04-03 01:43:02 +00:00
Yuya Nishihara
27824420aa tests: port test_sign_unsign_commands.rs to TestWorkDir API 2025-04-03 01:43:02 +00:00
Yuya Nishihara
b1bc934bad tests: port test_show_command.rs to TestWorkDir API 2025-04-03 01:43:02 +00:00
Scott Taylor
a902e63e65 merge_tools: add ":ours" and ":theirs" merge tools
We may want to implement these as options to `jj resolve` instead in the
future, but this is a simpler solution for now.
2025-04-02 22:09:15 +00:00
Scott Taylor
238a5587b0 merge_tools: split DiffTool and MergeTool enums 2025-04-02 22:09:15 +00:00
Aleksey Kuznetsov
3c907cc019 cli: Add --sort option to the bookmark list command
This allows different sort orders for the bookmarks list, not only
alphabetically (by name).

Relates to #3831
2025-04-02 14:46:20 +00:00
Siva Mahadevan
24cd079307 templates: create new git_format_patch_email_headers template
With this template, a 'git format-patch' compatible
email message can be generated using something like:

jj show --git --template git_format_patch_email_headers <rev>
2025-04-02 13:16:47 +00:00
Ilya Grigoriev
ecde53c5bb cli completion: add completion for jj git push --named
Follow-up to https://github.com/jj-vcs/jj/pull/5698
2025-04-01 16:56:33 +00:00
Remo Senekowitsch
fb1a27ff09 cli: require --deleted to push deleted bookmarks 2025-04-01 15:58:50 +00:00
Yuya Nishihara
5db62a6b96 tests: port test_revset_output.rs to TestWorkDir API 2025-04-01 15:00:17 +00:00
Yuya Nishihara
f1a52d8504 tests: port test_revert_command.rs to TestWorkDir API 2025-04-01 15:00:17 +00:00
Yuya Nishihara
4d4de68c91 tests: port test_restore_command.rs to TestWorkDir API 2025-04-01 15:00:17 +00:00
Yuya Nishihara
3ba2ea7ace tests: port test_resolve_command.rs to TestWorkDir API 2025-04-01 15:00:17 +00:00
Yuya Nishihara
169a8b3f35 tests: set up fake editor early in test_{resolve,restore}_command.rs
This helps avoid borrowing issue in the next patch.
2025-04-01 15:00:17 +00:00
Yuya Nishihara
4bcebe678c cli: pad empty description intro/instruction lines with "JJ:"
Since 7618b52b "cli: consider 'JJ:' lines as comments also when not followed by
space", lines starting with "JJ:" (without space) are also ignored. We can
simply add "JJ:" prefix to empty intro/instruction lines.

Closes #5484
2025-04-01 02:02:02 +00:00
Yuya Nishihara
fd05b6f4cb cli: make description template insert blank line if old description was empty
This helps detect whether the last line is "JJ:" instruction or not. It seems
also nice that I don't have to insert newline to reflow the edited paragraph.
2025-04-01 02:02:02 +00:00
Robin Stocker
0456701e18 cli: Print @ and @- in status and print_updated_working_copy_stats
This helps newcomers learn/remember what @ and @- stand for.
2025-03-31 11:57:04 +00:00
Robin Stocker
2d9c72ffb1 cli/tests: Prevent git.subprocess from reading outside git config
A subset of cli tests could fail if the system /etc/gitconfig had
configuration interfering with the tests. The cause seems to be running
of `jj` commands that would in turn use a `git` subprocess.

Fix this by setting `GIT_CONFIG_SYSTEM` and `GIT_CONFIG_GLOBAL`, like
in `hermetic_git`.

Fixes #6159
2025-03-31 10:46:57 +00:00
Yuya Nishihara
60372ead43 tests: port test_repo_change_report.rs to TestWorkDir API 2025-03-31 10:35:36 +00:00
Yuya Nishihara
d15aa8c1c1 tests: port test_rebase_command.rs to TestWorkDir API 2025-03-31 10:35:36 +00:00
Yuya Nishihara
f3ed4cfed6 tests: port test_parallelize_command.rs to TestWorkDir API 2025-03-31 10:35:36 +00:00
Yuya Nishihara
da8ff3083c tests: port test_operations.rs to TestWorkDir API 2025-03-31 10:35:36 +00:00
Yuya Nishihara
022147e4f4 diff: use BString more consistently in rendering functions 2025-03-31 10:34:14 +00:00
Yuya Nishihara
a3a59abe74 diff: pass left/right contents and line number pairs by array
When rendering diff of conflicts, it might make sense to show diff of negative
(or base) terms with "removed"/"added" labels swapped. For example, diffs
between A and B-C+D can be rendered as

  {left, right} = {A (-), B (+)}, {A (+), C (-)}, {A (-), D (+)}

by padding -A+A to the left side. To achieve that, I'm thinking of adding
labels: [&str; 2] parameter. This patch will help keep function arguments more
consistent there.

FWIW, I also tried rendering in {A (-), B (+)}, {C (-), D (+)} forms. This
seemed not intuitive because, when diffing, we compare two distinct states. In
the example above, the diff {C, D} should be considered an internal state at the
right side, not the states pair to be diffed.
2025-03-31 10:34:14 +00:00
Ilya Grigoriev
9db0739320 cli git push: new --named NAME=REVISION argument to create and immediately push bookmark
Fixes #5472
2025-03-31 03:51:28 +00:00
Yuya Nishihara
3f5f872204 view: rename workspace "id" to "name"
This matches the current implementation.
2025-03-31 03:39:29 +00:00
Yuya Nishihara
e66c545438 view: replace WorkspaceId by string-like newtypes
I think this makes more sense because WorkspaceId is currently a human-readable
name. In error/status messages, workspace names are now printed in revset
syntax.

New WorkspaceId types do not implement Default. It would be weird if string-like
type had non-empty Default::default(). The DEFAULT constant is provided instead.
2025-03-31 03:39:29 +00:00
Yuya Nishihara
a08d53bef8 cli: do not panic on non-utf-8 workspace name to add 2025-03-31 03:39:29 +00:00
Yuya Nishihara
f87db58617 view: rename RemoteRefState::Tracking to Tracked
In jj's model, a local bookmark "tracks" remote bookmarks. It's wrong to call
a remote bookmark state as "tracking".
2025-03-31 01:41:31 +00:00