Re: [PATCH 4/4] git-rebase -i: New option to support rebase with merges
Hi Junio,
Junio C Hamano schrieb am Mon 24. Mar, 11:35 (-0700):
Show 7 quoted lines
> If you have this history:
>
> o---o---o---o---o---Z
> /
> X---Y---A---B
> \ \
> C---D---M---E
I would like to extend this example:
o---o---o---o---o---Z
/
X---Y---A-------B
\ \
C---D---N---M---E
/
VShow 18 quoted lines
> and you want to transplant the history between X..E on top of Z, from the
> command line you would say:
>
> $ git rebase --interactive -p --onto Z X E
>
> First let's think what you would do if you want to do this by hand. The
> sequence would be:
>
> $ git checkout Z^0 ;# detach at Z
>
> $ git cherry-pick Y
> $ git tag new-Y ;# remember it
> $ git cherry-pick A
> $ git cherry-pick B
> $ git tag new-B ;# remember it
> $ git checkout new-Y
> $ git cherry-pick C
> $ git cherry-pick D
> $ git merge new-B ;# this reproduces M
> $ git cherry-pick E
>
> $ git branch -f $the_branch && git checkout $the_branch
Show 12 quoted lines
> Perhaps we can make it clearer by introducing a few more primitives to the
> todo language: mark, reset and merge. The above illustrated history would
> then become:
>
> pick Y
> mark #0
> pick A
> pick B
> mark #1
> reset #0
> pick C
> pick D
Show 7 quoted lines
> mark #2
> merge #1 #2
> pick E
>
> You can change any of the "pick" to "edit, or drop it, and you can reorder
> "pick" in a sequence of "pick", but you cannot change "mark", "reset",
> "merge", or move "pick" across insn that was not originally "pick".
This way we can also merge more than two branches. Your idea sounds good.
Bye, Jörg.
--
Nichts ist so langweilig, wie die Wiederholung seinerselbst.
(Marcel Reich‐Ranicki)