Re: Merging using only fast-forward

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Sverre Hvammen Johansen
Date: Thursday, January 17, 2008 - 11:58 pm

On Jan 16, 2008 10:53 PM, Sverre Hvammen Johansen <hvammen@gmail.com> wrote:

I have been testing octopus merges and figured it is not very smart with
respect to fast forward.  I would like it to do a fast forward whenever it
makes sense to do that.  Consider the following:

     -- c1 -- A
   /              /  \
c0 -- c2 --      C
   \              \  /
     -- c3 -- B

A is a merge between c1 and c2, B is a merge between c2 and c3, and C is a
merge between A and B.

c1 merged with A does a fast forward to A, A merged with C does a fast forward
to C, but an octopus merge of c1 with A and C does not fast forward to
C.  I would
expect it to fast forward to C.  The commit graph above have several other cases
where an octopus merge can be reduced to a fast forward or a recursive merge.

I suggest a separate pass before we choose merge strategy.  Remove commits
that can be fast forwarded to any of the other commits from the
equation and fast
forward the current branch if possible.  The remaining commits are then taken
into consideration.  This may reduce the number of commits and thus result in
a fast forward or another merge strategy.

I intend to make the patch for the option --ff-only as simple as
possible, where it
will fail where more than two commits are involved.  If the above suggested pass
is implemented it should also take affect for --ff-only.

Does this make sense?

-- 
Sverre Hvammen Johansen
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Merging using only fast-forward, Sverre Hvammen Johansen, (Wed Jan 16, 8:54 am)
Re: Merging using only fast-forward, Randal L. Schwartz, (Wed Jan 16, 9:27 am)
Re: Merging using only fast-forward, Junio C Hamano, (Wed Jan 16, 1:31 pm)
Re: Merging using only fast-forward, Sverre Hvammen Johansen, (Wed Jan 16, 3:38 pm)
Re: Merging using only fast-forward, Junio C Hamano, (Wed Jan 16, 3:49 pm)
Re: Merging using only fast-forward, Sverre Hvammen Johansen, (Wed Jan 16, 11:53 pm)
Re: Merging using only fast-forward, Sverre Hvammen Johansen, (Thu Jan 17, 11:58 pm)
Re: Merging using only fast-forward, Junio C Hamano, (Fri Jan 18, 2:25 pm)
Re: Merging using only fast-forward, Sverre Hvammen Johansen, (Sat Jan 19, 3:28 am)
Re: Merging using only fast-forward, Sverre Hvammen Johansen, (Sat Jan 19, 3:38 am)
Re: Merging using only fast-forward, Junio C Hamano, (Sat Jan 19, 3:43 am)
Re: Merging using only fast-forward, Sverre Hvammen Johansen, (Sat Jan 19, 5:39 am)
Re: Merging using only fast-forward, Sverre Hvammen Johansen, (Sun Jan 20, 11:26 pm)