Sometimes there is a need to re-work a large MR and today a co-worker showed with his vim the following workflow.
- Make a new branch from master
- Use vimdiff to compare side-by-side the MR branch and the new branch
- Take some logical sets of changes (I’ll guess they were patches/hunks) with a single key press (that is, he copied some diff lines from MR branch to new branch and made a commit out of that. Side-by-side diff view was nice as it showed immediately that the files/lines were the same after copying and commit. And he could easily change the file which he compared and move forward and backward to the next/prev the hunk etc.
- After doing those new commits on the new branch, he was able to split the original into nicer set of commits, and especially, into a set of smaller MR’s (which is nice for the reviewers).
- And at the end, he could show that the diff between branches was nill so that the re-organized commits did the same job.
Picking up commits from the large MR wasn’t ok as there already had happened a lot of re-writing etc. (Commits combined changes of un-related sub-features.)
Is the above workflow possible with kakoune at the moment? (I think some time ago it was said that there is no side-by-side view at kakoune yet. But is this so? In a way fifo buffer using the diff
tool giving the side-by-side might could do it somehow. Anyhow, not sure at all.)
And of course it would be interesting to hear if you have some other ways of doing approximately the same thing (of re-organizing a large MR into manageable pieces) with kakoune (or some other terminal tool).