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

Expanding tag list gets IceTipTagModel DNU #branchName #1783

Closed
daniels220 opened this issue Dec 16, 2023 · 0 comments
Closed

Expanding tag list gets IceTipTagModel DNU #branchName #1783

daniels220 opened this issue Dec 16, 2023 · 0 comments

Comments

@daniels220
Copy link
Contributor

Opening Repository view (IceTipRepositoryBrowser) on a repo with tags and clicking the disclosure triangle to view them gives IceTipTagModel DNU #branchName, from IceTipResetBranchToThisCommitCommand>>defaultNameFromContext. If you close the debugger and try to right-click in the commit list, it happens again. If you explicitly select a branch, the error goes away.

Looking at #defaultNameFromContext, the sibling IceTipBranchModel does understand this message, and clearly the code was written assuming selectedBranch would return one of those. It seems like self selectedBranch is whatever is selected in the sidebar, and selectedCommitish is what's selected in the main panel. But the sidebar selection might not be a branch, and then we have a problem.

I think the problem here is that it isn't really valid/reasonable to say "reset to ". You can do something like it, but you wouldn't use git reset on the command-line, you'd use git tag -f. And indeed IceTag has no ability to modify what commit it points to, and creating one is done externally by IceGitCommit>>createTag:. So the command should just be disabled or absent from the menu when a tag is selected instead of a branch. If we wanted to have a separate "move tag to ", we could, but it would need to be written basically from scratch using a call to createTag:targetId:force: true.

After some poking around I think I figured out the right way to do this, PR incoming.

daniels220 added a commit to shoshanatech/pharo-iceberg that referenced this issue Dec 16, 2023
daniels220 added a commit to shoshanatech/pharo-iceberg that referenced this issue Dec 16, 2023
guillep added a commit that referenced this issue Jan 18, 2024
Hide "Reset <branch> to <commitish>" when a tag is selected (fixes #1783)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant