git-imerge icon indicating copy to clipboard operation
git-imerge copied to clipboard

Interactive Rebase With History Preserving Past Merges

Open RandomDSdevel opened this issue 5 years ago • 1 comments

     Twice now, I've been working in different repositories and wishing that 'git imerge' had an equivalent to 'git rebase -i --preserve=merges' I could use to 'rebase with history.' For whatever reason, I have a feeling this feature request could prove quite difficult to implement, but I just thought I'd put it out there. (I can split this into two feature-request issues — one each for interactive 'git imerge' 'rebase with history' and 'imerge' 'rebase with history' preserving past merges, respectively —&hinsp;if desired/on request.)

RandomDSdevel avatar Sep 22 '20 14:09 RandomDSdevel

I don't know a lot of the details of --preserve=merges so it's hard for me to say how difficult it would be. ISTM that it depends a lot on the branch point of the merged-in branches.

If a merged-in branch sprouted from the target branch before the branch being rebased, then it seems like it would be a relatively simple matter of rebasing the -m1 diff of the merge commit, then adding the original second parent to the rebased merge commit. I don't think that this would require dramatic changes to git-imerge.

But if the merged-in branch has other ancestors on the to-be-rebased branch, then it gets more complicated.

I don't expect to have time to work on this myself in the foreseeable future.

mhagger avatar Sep 22 '20 15:09 mhagger