Re: [PATCH 4/4] git-rebase -i: New option to support rebase with merges

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Junio,

Junio C Hamano schrieb am Mon 24. Mar, 11:35 (-0700):
> 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
                 /
                V

> 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 V
>         $ git merge new-B ;# this reproduces M
>         $ git cherry-pick E
> 
> 	$ git branch -f $the_branch && git checkout $the_branch


> 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
merge V

V is not a mark.

> 	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)

Attachment: signature.asc
Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux