jj/lib
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
..
benches cli, lib: move to Rust 2024 language edition 2025-07-28 17:05:41 +00:00
gen-protos protos: rename op_store to simple_op_store 2025-08-14 14:15:17 +00:00
proc-macros cli, lib: move to Rust 2024 language edition 2025-07-28 17:05:41 +00:00
src git_backend: use first tree as base tree for conflicts 2025-12-21 21:37:14 -06:00
tests conflicts: show "noeol" state separately for each side of a diff 2025-12-20 17:43:41 +00:00
testutils merge: implement IntoIterator for references of Merge<T> 2025-12-09 23:28:23 +00:00
Cargo.toml backend: remove unused TreeValue::Conflict and read/write methods 2025-09-04 16:26:44 +00:00
LICENSE cargo: add LICENSE file to each crate we publish 2023-09-22 21:48:28 -07:00