Re: [PATCH v2 04/13] Teach rebase interactive the mark command
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:33
Johannes Schindelin [off-list ref] writes:
quoted
But instead you are thinking of letting me just say "X", and somehow make the machinery guess by noticing "Ah, original X is a merge between original A and B, and we have a merge between rewritten A and rewritten B, so we will treat that merge as rewritten "X"? I actually was hoping we could avoid that, which feels messy.... But this got me thinking, and I think that to leave out the first parent was another mistake I made, so I really would like to have this syntax: merge <orig-commit> <parent1> <parent2>... <message> This would allow to change the parents in the interactive rebase, and if <parent1> is not the current commit at that point, it would implicitly call "reset". What appeals to me is the simplicity of this approach: you refer to the commits by calling them by their (original) name.
Ok, that clears my confusion, but it raises another issue.
In the context of "rebase -i", this may not be a problem, but by forcing
us to name commits always with original commits, we cannot build (instead
of rebuild) a history that does not yet exist using the sequencer
machinery, can we?
If we want to transplant "^C ^N O" in this history elsewhere:
--o---C---N
/
B---M
/ /
O---A
while inserting a new fix-up commit F on top of B before we merge that
side branch to rewritten A:
--o---C---N'
/
B'--X---M'
/ /
O---Q-------A'
Would/Should the machinery somehow figure out that the merge between the
rewritten A (which is A') and an inserted commit X (which is made on top
of the rewritten B) corresponds to M in the original history?
This is not a made up example, but something I have to do once (on my
non-git days) or many more times (on my git days) every day when
rebuilding 'pu' on top of updated 'next' using updated tips of topic
branches. I was hoping that the sequencer mechanism can help me
automating the process a bit more.