-
Notifications
You must be signed in to change notification settings - Fork 496
Deleting git tag or branch deletes ancestors and breaks jj undo
#6325
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
Comments
Maybe you know, but it's by design. In colocated repos, commits that become unreachable at git side are imported (= abandoned.) You can turn off this behavior by config: https://jj-vcs.github.io/jj/latest/config/#abandon-commits-that-became-unreachable-in-git
Minor correction: The whole problem is that jj doesn't have tag management functions yet, so any tag changes in Git are imported (no matter if they were previously observed and had been imported.) |
Ah, I did not know! Thanks a lot for the pointer, I'll change the setting.
I'm fine with the tag itself not being recover
7F88
ed but I'd like to get the abandoned commits back. As it is now, I was both surprised that the tag deletion has such a big impact, and to recover the lost work I had to look for git commit hashes in |
I kind of agree. I just tried to explain why the commits abandoned by tag deletion couldn't be recovered (or to be more precise, re-abandoned after |
Description
Deleting a tag or branch with a git command (
git tag -d
,git branch -d
) seems to delete related commit and its ancestors in jj. And evenjj undo
does not restore them.Steps to Reproduce the Problem
The same behavior is observed when creating and deleting a branch via git instead of a tag.
Expected Behavior
I expect
git tag
operations to have no impact on the jj tree. Especially given that there is no jj-native API for manipulating tags.For branches, I could understand interpreting a branch removal as intent to delete the related work. And a case can be made that we should always use
jj bookmark
rather thangit branch
. However, I don't think commits should be deleted because of branch manipulation when they already have descendants.In either case,
jj undo
should fully recover the lost commits.Actual Behavior
Using
git tag -d
andgit branch -d
leads tojj
behavior which cannot be recovered withjj undo
.Specifications
The text was updated successfully, but these errors were encountered: