5 ms·
> move the fixup commit just after the bad commit (M-↑), press f on the fixup commit to tell rebase to merge it with the bad commit, That's what --autosquash i
by globular-toast 6y ago
> move the fixup commit just after the bad commit (M-↑), press f on the fixup commit to tell rebase to merge it with the bad commit,
That's what --autosquash is for. If you do fixup commits correctly (using --fixup), it will put them in the correct place and mark them as fixups for you.
- shepmaster 6y ago> using --fixup If I understand you correctly, this requires that I think about which commit I want to fixup. Once identified, I can mark my fixup with what commit it should be combined with automatically. My understanding of the article is that it attempts to automatically figure out which commit to combine with. That’s the feature that I’m interested in.
- globular-toast 6y agoYeah, it does require you to think about it. But magit has really quick and easy diffing and blame so it can make it significantly easier. In practice I rarely have to think very hard before knowing which commit to fixup.
- jpeloquin 6y agoSo I guess what I should be doing is make fix → magit-blame to get the commit ID for the last prior edit → copy commit ID or message to clipboard → magit commit with `c F`, C-s to the commit ID I just copied, and C-c C-c to set up and run the autosquash rebase.
- shepmaster 6y agoThis process is what I think the article describes and what I’m curious if can be automated by magit itself.
- jpeloquin 6y agoMagit appears to have an integration with 'git absorb'. The issue that tracked the integration discussed git absorb as providing similar function to git autofixup. I don't particularly desire unsupervised changes to my commit history though so don't plan on looking into it further. https://github.com/magit/magit/issues/3053 https://github.com/magit/magit/issues/3053