jj/cli/tests
Scott Taylor 3fe784d50c git_backend: use first tree as base tree for conflicts
Currently, checking out a commit with conflicts in a colocated workspace
causes many editors to show all existing files as added since they
aren't present in the Git HEAD commit. Using the tree of the first side
of the commit as a base tree and then adding the '.jjconflict-*' trees
on top of it would cause any files identical to the first tree to show
as unchanged, matching Git's conflict behavior.

One potential downside to this change is that it becomes harder for a
user to notice if they incorrectly check out a conflicted commit using
`git switch`, since previously all of their files would've disappeared
so it would be more difficult to ignore. However, I think this could be
solved a different way, such as by adding a warning when snapshotting if
'.jjconflict' files are detected. Keeping the files from the first
tree also has the benefit that '.gitignore' files will still be present,
meaning that when a user does `jj abandon` to recover, it won't delete
their ignored files.

Using 'JJ-CONFLICT-README' as the name for the readme file instead of
'README' makes it more clear that this file is related to the
'.jjconflict-*' trees, since now the repo's actual README file might be
present as well in the tree.
2025-12-21 21:37:14 -06:00
..
common tests: set up local TMPDIR which should be cleaned up by test runner 2025-12-21 01:54:31 +00:00
sample-configs cli: enable glob string matching globally 2025-12-15 04:27:32 +00:00
cli-reference@.md.snap templates: add "divergent" label to log for divergent changes 2025-12-20 16:55:51 +00:00
datatest_config_schema.rs deps: update jsonschema to 0.37.1, adapt to breaking changes 2025-11-25 17:58:09 +00:00
datatest_runner.rs tests: use jsonschema directly instead of taplo(1) 2025-08-08 16:19:30 +00:00
runner.rs cli: add a very basic jj file search (like git grep) 2025-12-18 06:31:37 +00:00
test_abandon_command.rs cli: enable glob string matching globally 2025-12-15 04:27:32 +00:00
test_absorb_command.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_acls.rs tests: port test_acls.rs to TestWorkDir API 2025-03-12 02:18:56 +00:00
test_advance_bookmarks.rs cli: enable glob string matching globally 2025-12-15 04:27:32 +00:00
test_alias.rs docs: jj-vcs.github.io -> jj-vcs.dev 2025-11-26 00:36:39 +00:00
test_bisect_command.rs templates: add "divergent" label to log for divergent changes 2025-12-20 16:55:51 +00:00
test_bookmark_command.rs templates: add "divergent" label to log for divergent changes 2025-12-20 16:55:51 +00:00
test_builtin_aliases.rs cli: enable glob string matching globally 2025-12-15 04:27:32 +00:00
test_commit_command.rs config: remove outdated migration rules 2025-12-11 00:49:58 +00:00
test_commit_template.rs templates: add "divergent" label to log for divergent changes 2025-12-20 16:55:51 +00:00
test_completion.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_concurrent_operations.rs tests: update cargo insta snapshots 2025-12-09 18:59:34 +00:00
test_config_command.rs tests: update cargo insta snapshots 2025-12-09 18:59:34 +00:00
test_config_schema.rs deps: update jsonschema to 0.37.1, adapt to breaking changes 2025-11-25 17:58:09 +00:00
test_copy_detection.rs tests: port test_copy_detection.rs to TestWorkDir API 2025-03-13 16:13:12 +00:00
test_debug_command.rs cli: add debug command that dumps stats of stacked table 2025-12-17 10:38:11 +00:00
test_debug_init_simple_command.rs lib: rename the LocalBackend to SimpleBackend 2025-03-17 17:17:11 +00:00
test_describe_command.rs config: remove outdated migration rules 2025-12-11 00:49:58 +00:00
test_diff_command.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_diffedit_command.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_duplicate_command.rs cli: deprecate --destination/-d in favor of --onto/-o 2025-11-08 14:56:37 +00:00
test_edit_command.rs cli: edit: parse -r option properly 2025-12-19 09:39:53 +00:00
test_evolog_command.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_file_annotate_command.rs rewrite: add conflict labels when merging commit trees 2025-12-20 04:03:57 +00:00
test_file_chmod_command.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_file_list_command.rs cli: warn when jj file list fileset doesn't match 2025-11-14 14:51:27 +00:00
test_file_search_command.rs conflicts: show "noeol" state separately for each side of a diff 2025-12-20 17:43:41 +00:00
test_file_show_command.rs rewrite: add conflict labels for rebased commits 2025-12-20 04:03:57 +00:00
test_file_track_untrack_commands.rs tests: update cargo insta snapshots 2025-12-09 18:59:34 +00:00
test_fix_command.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_generate_md_cli_help.rs tests: resolve directory path to run_jj_in() relative to env_root 2025-02-25 15:40:14 +00:00
test_gerrit_upload.rs cli: gerrit: remove excessive newlines and "warning:" prefix, respect --quiet 2025-12-18 00:13:25 +00:00
test_git_clone.rs cli: enable glob string matching globally 2025-12-15 04:27:32 +00:00
test_git_colocated.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_git_colocation.rs cli: git: print current Git HEAD by "colocation status" 2025-12-10 14:26:47 +00:00
test_git_fetch.rs templates: add "divergent" label to log for divergent changes 2025-12-20 16:55:51 +00:00
test_git_import_export.rs templates: add "divergent" label to log for divergent changes 2025-12-20 16:55:51 +00:00
test_git_init.rs cli: enable glob string matching globally 2025-12-15 04:27:32 +00:00
test_git_private_commits.rs cli: enable glob string matching globally 2025-12-15 04:27:32 +00:00
test_git_push.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_git_remotes.rs cli,lib: add suport for the push URL in git remote add 2025-12-10 09:15:06 +00:00
test_git_root.rs tests: update cargo insta snapshots 2025-12-09 18:59:34 +00:00
test_gitignores.rs git: write change-id header by default 2025-05-08 23:05:38 +00:00
test_global_opts.rs templates: remove git_head() from default and test templates 2025-12-10 14:26:47 +00:00
test_help_command.rs cli: help: look up subcommand without using error path 2025-09-05 00:26:12 +00:00
test_identical_commits.rs templates: add "divergent" label to log for divergent changes 2025-12-20 16:55:51 +00:00
test_immutable_commits.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_interdiff_command.rs conflicts: update conflict marker format 2025-12-20 04:03:57 +00:00
test_log_command.rs cli: remove newline addition between template and content 2025-12-22 02:47:58 +00:00
test_metaedit_command.rs templates: add "divergent" label to log for divergent changes 2025-12-20 16:55:51 +00:00
test_new_command.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_next_prev_commands.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_op_revert_command.rs templates: add "divergent" label to log for divergent changes 2025-12-20 16:55:51 +00:00
test_operations.rs cli: remove newline addition between template and content 2025-12-22 02:47:58 +00:00
test_parallelize_command.rs revset: enable glob string matching by default 2025-12-15 04:27:32 +00:00
test_rebase_command.rs templates: add "divergent" label to log for divergent changes 2025-12-20 16:55:51 +00:00
test_repo_change_report.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_resolve_command.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_restore_command.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_revert_command.rs tests: update cargo insta snapshots 2025-12-09 18:59:34 +00:00
test_revset_output.rs revset: enable glob string matching by default 2025-12-15 04:27:32 +00:00
test_root.rs lib: rename the LocalBackend to SimpleBackend 2025-03-17 17:17:11 +00:00
test_show_command.rs cli: show: parse -r option properly 2025-12-19 09:39:53 +00:00
test_sign_unsign_commands.rs tests: exercise unsigning triggering rebasing 2025-12-12 02:55:55 +00:00
test_simplify_parents_command.rs tests: get current operation id without running jj 2025-08-26 00:27:29 +00:00
test_sparse_command.rs tests: exercise sparse edit with invalid path 2025-12-12 02:55:55 +00:00
test_split_command.rs templates: add "divergent" label to log for divergent changes 2025-12-20 16:55:51 +00:00
test_squash_command.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_status_command.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_tag_command.rs cli: enable glob string matching globally 2025-12-15 04:27:32 +00:00
test_templater.rs cli_util: use change offset in conflict hint when necessary 2025-12-21 14:44:31 +00:00
test_undo_redo_commands.rs cli undo: warn about undoing push operations 2025-11-02 16:13:00 +00:00
test_util_command.rs tests: exercise util install-man-pages 2025-12-12 02:55:55 +00:00
test_working_copy.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
test_workspaces.rs git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00