Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic in built-in diff editor when replacing directory with file #5189

Open
arxanas opened this issue Dec 25, 2024 · 0 comments
Open

Panic in built-in diff editor when replacing directory with file #5189

arxanas opened this issue Dec 25, 2024 · 0 comments
Labels
🐛bug Something isn't working scm-record Issues relating to the scm-record library, used as the default interactive diff/merge editor.

Comments

@arxanas
Copy link
Contributor

arxanas commented Dec 25, 2024

I'm not sure if I should make a new issue, but I got a consistent unreachable panic corner case type of thing that seems related to this (there is a possibility this is precisely what you guys are trying to fix 😅)

Basically if you replace a folder with a file (in my case it was a symlink) and then try to split you get a panic.

minimal repro:

λ jj git init test
Initialized repo in "test"
λ cd test
λ mkdir folder
λ touch folder/.keep
λ jj ci -m 'added folder'
Working copy now at: (x) c76fc22 (empty) (no description set)
Parent commit      : (u) 9092cba added folder
λ rm -r folder
λ touch folder
λ jj split
Hint: Using default editor ':builtin'; run `jj config set --user ui.diff-editor :builtin` to disabl
e this message.
thread 'main' panicked at cli/src/merge_tools/builtin.rs:205:13:
internal error: entered unreachable code: list of changed files included a tree: TreeId("29a422c192
51aeaeb907175e9b3219a9bed6c616")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Originally posted by @necauqua in #3702 (comment)


On this topic, I've successfully used property-based testing for incremental file changes in a similar context. It would be good to try it here to fuzz for panics, at least.

@arxanas arxanas added 🐛bug Something isn't working scm-record Issues relating to the scm-record library, used as the default interactive diff/merge editor. labels Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Something isn't working scm-record Issues relating to the scm-record library, used as the default interactive diff/merge editor.
Projects
None yet
Development

No branches or pull requests

1 participant