Open waffleboot opened 9 months ago
Just to confirm, the merge commit is HEAD
?
I can reproduce it. This command is currently only available for regular (non-merge) commits, because of the way it's implemented (as you noticed, it is looking for a "pick" commit). The same is true for "move commit up/down", "fixup", and "squash down". It would be nice if these were all disabled instead of failing with a cryptic error message, as long as we don't support them.
As for whether it makes sense to support them: "drop" is probably the only one for which the answer is yes. "Fixup" and "Squash down" don't make sense for merge commits, and "move down" is dangerous because you might move the commit to before the commit it's merging in. I'd probably disable that just to be safe, and then disable "move up" as well for consistency.
As long as "drop" is not supported directly in the normal commits view, as a workaround you can press "e" on the last commit before the branch, and then drop it there; this works. Note that this is a bit dangerous though, because lazygit's rebase view doesn't show the complete picture; it omits the "label" and "reset" commands that you can see by doing git rebase --edit-todo
. Because of that, it's impossible to tell for the "pick" commands whether those are regular commits on your branch, or commits that will be brought in by a later merge. If you drop a merge from this view, it will also implicitly drop all the "pick" commits that are brought in by the merge, but it's impossible to see, and it may or may not be what you intended (maybe you wanted to "flatten" the merge as if you had rebased without --rebase-merges
). So the whole thing is a bit confusing, and it would be nice if we could find ways to improve all this.
Final word of advice: just don't merge master into feature branches (rebase them onto master instead), you can avoid a lot of hassle and confusion this way.
Describe the bug
I tried to drop merge commit. And I see error message:
To Reproduce Steps to reproduce the behavior:
Expected behavior
Commit should be dropped.
Version info: Run
lazygit --version
and paste the result herecommit=, build date=, build source=homebrew, version=0.40.2, os=darwin, arch=arm64, git version=2.43.0
Run
git --version
and paste the result heregit version 2.43.0
Additional context
The reason is
EditRebaseTodo
tries to findpick
command instead ofmerge
.This is
git-rebase-todo
:The latest command is
merge
while we try to findpick
command to drop it.