home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] want to clarify a fast-forward merge in git

  • Subject: Re: [OCLUG-Tech] want to clarify a fast-forward merge in git
  • From: Alex Pilon <alp [ at ] alexpilon [ dot ] ca>
  • Date: Sun, 26 Apr 2015 12:51:35 -0400
On Sun, Apr 26, 2015 at 05:19:00AM -0400, Robert P. J. Day wrote:
>   i'm well aware of the standard behaviour of a FF merge in git, but
> i'm looking at a git book

Published… or are you under an NDA?

> which shows a figure purporting to show a FF merge and it confuses the
> heck out of me.

It may be a stupid question… are you sure it's the right figure? Some
typographical software sometimes confusingly pushes figures down, to
‘make everything fit’ optimally.

Without context, which you may not be in a position to provide, it's
hard to guess what's going on below, since we only have one figure and
your interpretation thereof.

> the figure shows this (using different colours to show commits on
> different branches):
>
>                      Y1 -- Y2 -- Y3 (branches before merging)
>                     /
>             ... -- X -- X1 -- X2
>
> and the alleged result of a FF merge:
>
>             ... -- X -- X1 -- X2 -- Y1 -- Y2 -- Y3
>
> i'm confused -- i thought a FF merge was applicable *only* if, after
> branching, you did no further work on the main branch.

Yes, if you consider the non-main branch off the end of the main
branch to not just be an extension thereof. Pardon me, matter of
wording.

> the above clearly shows that further commits took place on the
> "master" branch, and then the branch commits were simply repositioned
> back to the master branch, which makes no sense to me.
>
>   does anyone know what the above might be referring to?

That's clearly a rebase of Y3 onto X2. The use of the word “merge” here
is incorrect.

Two, that's not Y1..Y3 in the result, but Y1′..Y3′, so the book's
notation is misleading. It's not exactly the same commit objects after
the rebase.

Attachment: pgpinbVKN8GTW.pgp
Description: PGP signature