14
© 2013 Codice Software All about Merge Recursive Pablo Santos Luaces @psluaces – Lead Engineer Manuel Lucio @mrcatacroquer – Plastic SCM Ambassador Follow us @plasticscm

Merge Recursive Explained

Embed Size (px)

DESCRIPTION

Merge Recursive explained. Find more info here: http://codicesoftware.blogspot.com/2012/01/more-on-recursive-merge-strategy.html

Citation preview

Page 1: Merge Recursive Explained

© 2013 Codice Software

All about Merge Recursive

Pablo Santos Luaces @psluaces – Lead Engineer

Manuel Lucio @mrcatacroquer – Plastic SCM Ambassador

Follow us @plasticscm

Page 2: Merge Recursive Explained

© 2013 Codice Software

Very simple merge

0

main

A foobar/foo.cA bar.c

1

2

3

C bar.c

Base & Destination

Result

Source

Page 3: Merge Recursive Explained

© 2013 Codice Software

A real merge

0

main

A foobar/foo.cA bar.c

1

2

4

C bar.c

Base Result

Source(theirs)

3

Destination(yours)

C bar.c

Page 4: Merge Recursive Explained

© 2013 Codice Software

2-way vs 3-way merge

0

main

A foobar/foo.cA bar.c

1

2

4

C bar.c

Base Result

Source(theirs)

3

Destination(yours)

C bar.c

bar.c bar.c

function foo(){}

Page 5: Merge Recursive Explained

© 2013 Codice Software

3-way merge

0

main

A foobar/foo.cA bar.c

1

2

4

C bar.c

Base Result

Source(theirs)

3

Destination(yours)

C bar.c

bar.c bar.c

function foo(){}

bar.c

Page 6: Merge Recursive Explained

© 2013 Codice Software

It is all about finding the right “base”

0

main

A foobar/foo.cA bar.c

1

2

4

C bar.c

Base Result

Source(theirs)

3

Destination(yours)

C bar.c

Page 7: Merge Recursive Explained

© 2013 Codice Software

It is all about finding the right “base”

Page 8: Merge Recursive Explained

© 2013 Codice Software

Enter merge recursive…

Page 9: Merge Recursive Explained

© 2013 Codice Software

A merge recursive case

main/task001

42

3

76

8

5

/ foo.c = A

edit / foo.c = B

edit / foo.c = C

main/task002

main

/ foo.c = A /foo.c = A

/foo.c = B

/foo.c = B

Page 10: Merge Recursive Explained

© 2013 Codice Software

The wrong option

7 8

5

/ foo.c = C

Conflict: Both contributor have changed.

????

/ foo.c = A

/foo.c = B

main/task001

42

3

76

8

5

edit / foo.c = C

main/task002

main

/ foo.c = A

/foo.c = B

Page 11: Merge Recursive Explained

© 2013 Codice Software

The right option

7 8

4

/ foo.c = C

/ foo.c = B

/foo.c = B

main/task001

42

3

76

8

5

edit / foo.c = C

main/task002

main / foo.c = Bedit / foo.c = B

Automatic - C

Page 12: Merge Recursive Explained

© 2013 Codice Software

How recursive works

Page 13: Merge Recursive Explained

© 2013 Codice Software

The right solution

main/task001

42

3

76

8

5

/ foo.c = A

edit / foo.c = B

edit / foo.c = C

main/task002

main

/ foo.c = A /foo.c = A

/foo.c = B

/foo.c = B

4 5

2

virt

/ foo.c = B

/ foo.c = A

/foo.c = A

Automatic - B

7 8/ foo.c = C / foo.c = B

rAutomatic - C

Page 14: Merge Recursive Explained

© 2013 Codice Software

Questions?

Pablo Santos Luaces @psluacesManuel Lucio @mrcatacroquer – Plastic SCM Ambassador

Follow us @plasticscm