You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the Bug
Drop commit in git graph drops a completely different commit instead of the one selected. When the tip of the checked-out branch is not a cherry-picked commit of the dropped commit, it seems nothing happens at all. Which is kind of non-functional, but at least doesn't accidentally drop the wrong commit.
Steps to Reproduce
Initial situation as shown in this picture
Right click the commit at the tip of the feature branch, choose Cherry pick… and confirm
Right click the commit at the tip of the feature branch, choose Drop… and confirm
The just cherry-picked commit is dropped from master instead.
Expected Behaviour
I expected the tip of the feature branch to be dropped, but the tip of master was dropped instead.
Environment
Git Graph Extension Version: 1.25.0
Visual Studio Code Version: 1.48.0 db40434f562994116e5b21c24015a2e40b2504e6 x64
Thanks for making me aware of this behaviour. After testing numerous scenarios, including the steps you describe, I also observe that unless the commit being dropped is on the checked-out branch, the Git command being run git rebase --onto <commit-hash>^ <commit-hash> doesn't behave as the user would expect. In every scenario I've tested Git Graph has called the correct underlying Git command with the correct arguments, it's just that the Git command is not behaving as expected.
After looking at other popular Git UI's, every UI that has the ability to drop commits only allows this action to be performed on the checked-out branch. This seems to confirm that this is a known limitation, so I should similarly disable "Drop..." for commits not on the checked-out branch.
I already have two conditions that disable the "Drop..." option based on Git constraints I had picked up when I initially implemented this functionality, I'll add a new constraint testing whether the commit is on the checked-out branch.
I'll have a beta release available for you to use in the next few hours that resolves this issue.
mhutchie
changed the title
Drop commit drops cherry-picked branch tip instead of selected
Only show "Drop Commit" action for commits on the checked-out branch
Aug 15, 2020
Describe the Bug
Drop commit in git graph drops a completely different commit instead of the one selected. When the tip of the checked-out branch is not a cherry-picked commit of the dropped commit, it seems nothing happens at all. Which is kind of non-functional, but at least doesn't accidentally drop the wrong commit.
Steps to Reproduce
Initial situation as shown in this picture
feature
branch, choose Cherry pick… and confirmfeature
branch, choose Drop… and confirmmaster
instead.Expected Behaviour
I expected the tip of the
feature
branch to be dropped, but the tip ofmaster
was dropped instead.Environment
db40434f562994116e5b21c24015a2e40b2504e6
x64Note
When I check-out the
feature
branch before the drop, it works correctly. Maybe the Drop… option should be disabled for non-checked-out branches.The text was updated successfully, but these errors were encountered: