git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Update the documentation for git-merge-base

From
Junio C Hamano <junkio@cox.net>
Date
May 16, 2006, 23:20 UTC
Message-ID
<7vbqtx4kv8.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0605160906150.3866@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 21 quoted lines
>  - In contrast, for git (current master branch), the numbers are 35 out of 
>    540, and there are lots of merges with many LCA's:
>
>     505 o
>      15 oo
>      13 ooo
>       2 oooo
>       3 ooooo
>       2 ooooooo
>
> I think the difference is that Junio does a lot of these branches where he 
> keeps on pulling from them, and never syncs back (which is a great 
> workflow). In contrast, the kernel tends to try to avoid that because the 
> history gets messy enough as it is ;)
>
> Anyway, the two commits that apparently have seven (!) LCA's in the git 
> tree should probably be checked out. They are probably a good thing to see 
> if git-merge-base really _really_ does the right thing, and whether they 
> really are true LCA's.
>
> They are commits ad0b46bf.. and e6a933bd.. respectively.

The first one is because at 1.3.0 I pulled everything from "next" to "master".

Usually "next" incorporates topic branches that stem from different commits on "master", and when a new topic is merged to "next", it gets the updates to "master" up to that point along with the new topic. When topics graduate (i.e. merged back) to "master", they do so at different pace.

      topic2          o---o---o---o---H---.
                     /                 \   \
      next   -----------o---o---E---o---I-------B
                   /   /       /             \   \
      topic1      /   /   o---D---.           \   \
                 /   /   /         \           \   \
      master ---G---o---C---o---o---F---o---o---A---X

The above illustration shows that two topics branched from master were cooked in next. Topic 1 branched from master at C, added two commits (its tip is at D), merged to next at E and then later merged to master at F. Similarly, topic 2 branched from master at G, added five commits (its tip is at H), merged to next at I and then later merged to master at A.

When merging "next" into "master" by merging A and B to produce X, tips of topics 1 and 2 (D and H, respectively) become the merge base.

Merging "next" wholesale to "master" is hopefully a rare event, but the seven bases you are seeing are the topic tips.

The other one is the other way around. From time to time, "next" itself gets updates from "master" to keep it in sync with fixes that occurred on "master" directly. Such a merge into "next" will have this picture but the principles are the same.

      topic2          o---o---o---o---H---.
                     /                 \   \
      next   -----------o---o---E---o---I-------B---Y
                   /   /       /             \     /
      topic1      /   /   o---D---.           \   /
                 /   /   /         \           \ /
      master ---G---o---C---o---o---F---o---o---A
Previous: Linus Torvalds
Message 7 of 7 in “Update the documentation for git-merge-base”
  1. Update the documentation for git-merge-baseFredrik Kuivinen, May 16, 2006
  2. Junio C HamanoMay 16, 2006
  3. Fredrik KuivinenMay 16, 2006
  4. Junio C HamanoMay 16, 2006
  5. Linus TorvaldsMay 16, 2006
  6. Linus TorvaldsMay 16, 2006
  7. Junio C HamanoMay 16, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.