-
Notifications
You must be signed in to change notification settings - Fork 343
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
cli: don't abandon non-discardable old wc commit by import_git_head() #3749
Conversation
Perhaps, the original intent was to abandon non-empty working-copy commit assuming it was rewritten by git (therefore it should be superseded by the current working-copy content.) However, there are other reasons that could make the HEAD out of sync (including concurrent jj operations), and abandoning non-empty commit can be a disaster. This patch turns it to safer side, and let user abandon non-empty commit manually. Fixes jj-vcs#3747
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I can't think of any downsides to this change. Hopefully it makes the colocation experience much better.
(Non-blocking) I tried out this PR in my copy of This time, the offending operation is a Here's the repo (50MB): https://ilya.gr/share/jj-bug-2024-05-24.tar.gz I definitely agree with the direction of this PR -- the "best" fix for the bug would be that the rules of the resolution of concurrent operation be such that any partial git import from a concurrent operation cleanly merges with the main operation and does not affect the outcome. This is easier said than done, of course. |
I haven't inspected the op log, but I think that's because an intermediate Maybe diverged wc pointers could be merged somehow, but I have no idea if that will work. |
fwiw, for background viewer processes, #2562 (comment) might help. |
Filed as #3754 |
Very good point. We could even have an option to forbid more than one instance of |
#3747
Checklist
If applicable:
CHANGELOG.md