Re: [DRAFT] Branching and merging with git

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux@...>
Cc: <git@...>
Date: Friday, November 17, 2006 - 9:11 pm

Junio C Hamano <junkio@cox.net> writes:


Having said that, I think it is not a good idea to talk about
octopus in introductory documents.  The 'feature' may be unique
to git and some people might even find it cool, but new people
should not be encouraged to use it until they understand the
ramifications.

The first ever octopus merge was just a bundle of five forked
development branches, each of which had only one commit since it
forked from the common parent.

           .-a-.  
          .--b--.
         O---c---X
          '--d--'
           '-e-' 

They were independent, un-overlapping changes.  "diff-tree -c"
would not show anything, and there was no inherent reason that
one change should come before the others, so in that sense,
presenting this as an octopus was making the history more
truthful than pretending one happened before another.

But octopus has a negative effect on bisecting performance.
Suppose commit X was bad and commit O was good.  Because X
bundles five branches into one, and we know one of them
(hopefully) is what introduced the regression, our task is to
find the guilty one commit among five commits.  But in order to
do so, we would end up having to test four commits.  That is,
knowing that a, b and c are Ok does not give us any useful
information to determine which of d or e is the bad one (after
learning that a, b and c are Ok, we still need to test d and if
it turns out to be Ok then we can finally say e is the bad one).

If I did not do an octopus and laid out the commit ancestry
graph this way when I gave them to Linus:

    O--a--b--c--d--e--X

the same bisect would have asked us check c first.  If it is
good, then we do not even have to test a or b.  The linear part
of the history is what bisect takes advantage of to cut the
search space efficiently, and an octopus actively defeats that.

So doing an octopus is a wrong thing to do, if there is a
possibility that something wrong is found later.  So people
should not do an octopus unless the component changes are all
truely trivial.

If you want an esoteric topic for an introductory documentation,
it would be more useful to talk about evil merges (an evil merge
is a merge commit whose result does not match any of its
parents).  A good example is found in

	git show v1.0.0

-
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:
Re: [DRAFT] Branching and merging with git, Theodore Tso, (Wed Jan 3, 1:04 pm)
Re: [DRAFT] Branching and merging with git, J. Bruce Fields, (Sun Jan 7, 7:44 pm)
Re: [DRAFT] Branching and merging with git, Theodore Tso, (Sun Jan 7, 8:40 pm)
Re: [DRAFT] Branching and merging with git, J. Bruce Fields, (Sun Jan 7, 8:46 pm)
Re: [DRAFT] Branching and merging with git, Guilhem Bonnefille, (Mon Jan 8, 8:38 am)
Re: [DRAFT] Branching and merging with git, J. Bruce Fields, (Tue Jan 9, 12:17 am)
Re: [DRAFT] Branching and merging with git , Horst H. von Brand, (Sun Jan 7, 9:46 pm)
Re: [DRAFT] Branching and merging with git, J. Bruce Fields, (Sun Jan 7, 10:22 pm)
Re: [DRAFT] Branching and merging with git, Junio C Hamano, (Sun Jan 7, 8:24 pm)
Re: [DRAFT] Branching and merging with git, J. Bruce Fields, (Sun Jan 7, 10:35 pm)
Re: [DRAFT] Branching and merging with git, Theodore Tso, (Mon Jan 8, 10:03 am)
Re: [DRAFT] Branching and merging with git, J. Bruce Fields, (Mon Jan 8, 10:41 pm)
Re: [DRAFT] Branching and merging with git, Andreas Ericsson, (Tue Jan 9, 4:46 am)
Re: [DRAFT] Branching and merging with git, Theodore Tso, (Tue Jan 9, 12:58 pm)
Re: [DRAFT] Branching and merging with git, J. Bruce Fields, (Wed Jan 10, 12:15 am)
Re: [DRAFT] Branching and merging with git, J. Bruce Fields, (Tue Jan 9, 11:49 am)
Re: [DRAFT] Branching and merging with git, Junio C Hamano, (Wed Jan 3, 1:08 pm)
Re: [DRAFT] Branching and merging with git, Junio C Hamano, (Thu Jan 4, 2:11 am)
Re: [DRAFT] Branching and merging with git, J. Bruce Fields, (Fri Nov 17, 1:44 pm)
Re: [DRAFT] Branching and merging with git, Theodore Tso, (Fri Nov 17, 11:32 am)
Re: [DRAFT] Branching and merging with git, J. Bruce Fields, (Fri Nov 17, 2:21 pm)
Re: [DRAFT] Branching and merging with git, J. Bruce Fields, (Sun Nov 19, 1:50 pm)
[PATCH] Documentation: add a "git user's manual", J. Bruce Fields, (Sun Nov 26, 12:01 am)
Git manuals, Petr Baudis, (Sun Nov 19, 1:59 pm)
Re: Git manuals, J. Bruce Fields, (Sun Nov 19, 3:36 pm)
Re: [DRAFT] Branching and merging with git, Junio C Hamano, (Fri Nov 17, 8:40 pm)
Re: [DRAFT] Branching and merging with git, Junio C Hamano, (Fri Nov 17, 9:11 pm)
Re: [DRAFT] Branching and merging with git, Junio C Hamano, (Wed Nov 22, 7:51 am)
Re: [DRAFT 2] Branching and merging with git, J. Bruce Fields, (Sun Dec 3, 9:19 pm)
Re: [DRAFT 2] Branching and merging with git, J. Bruce Fields, (Mon Dec 4, 3:23 am)
Re: [DRAFT 2] Branching and merging with git, Johannes Schindelin, (Mon Dec 4, 6:56 am)
Re: [DRAFT] Branching and merging with git, Sean, (Fri Nov 17, 11:57 am)
Re: [DRAFT] Branching and merging with git, Nguyen Thai Ngoc Duy, (Fri Nov 17, 12:19 pm)
Re: [DRAFT] Branching and merging with git, Sean, (Fri Nov 17, 12:34 pm)
Re: [DRAFT] Branching and merging with git, Marko Macek, (Fri Nov 17, 12:25 pm)
Re: [DRAFT] Branching and merging with git, Petr Baudis, (Fri Nov 17, 12:33 pm)
Re: [DRAFT] Branching and merging with git, Junio C Hamano, (Thu Nov 16, 9:09 pm)
Re: [DRAFT] Branching and merging with git, Junio C Hamano, (Fri Nov 17, 1:55 am)
Re: [DRAFT] Branching and merging with git, Junio C Hamano, (Thu Nov 16, 7:47 pm)
Re: [DRAFT] Branching and merging with git, Junio C Hamano, (Thu Nov 16, 9:31 pm)