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

Re: Comments on recursive merge..

From
Junio C Hamano <junkio@cox.net>
Date
Nov 11, 2005, 22:25 UTC
Message-ID
<7v4q6ilt3m.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0511071629270.3247@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 6 quoted lines
>> Another thing to consider is if it is fast enough for everyday
>> trivial merges.
>
> Hmm. True. The _really_ trivial in-index case triggers for me pretty 
> often, but I haven't done any statistics. It might be only 50% of the 
> time.

Just for fun, I randomly picked two heads/master commits from linux-2.6 repository (one was when I happened to have pulled the last time, and the other was when I thought this might be an interesting exercise and pulled again), and fed the commits between the two to a little script that looks at commits and tries to stat what they did (the script ignores renames so they appear as deletes and adds).

Here is what the script spitted out:
        Total commit objects: 3957
        Trivial Merges: 72 (1.82%)
        Merges: 225 (5.69%)
        Number of paths touched by non-merge commits:
                average 4.50, median 2, min 2, max 199
        Number of merge parents:
                average 2.00, median 2, min 2, max 2
        Number of merge bases:
                average 1.00, median 1, min 1, max 1
        File level merges:
                average 37.61, median 8, min 0, max 555
        Number of changed paths from the first parent:
                average 379.09, median 66, min 1, max 7553
        File level 3-ways:
                average 1.96, median 1, min 0, max 37
        Paths deleted:
                average 47.56, median 15, min 0, max 554

This counts what happened in individual devleoper's trees, subsystem maintainer trees and your tree, not just what you saw yourself.

Some observations.
 - Trivial Merges count is surprisingly high.  About 1/3 of
   merges are pure in-index merges.
 - Most of the commits (developer commits, not merges) are
   small and touches only a couple of paths.
 - Nobody does octopus ;-).
 - We did not have multi-base merge case during the period
   looked at (but the sample count is very low).
 - merge-one-file was called for only a handful (median 8)
   files, which is negligibly small compared to the total 17K
   files in the kernel tree, and fairly small compared to the
   number of changed paths from the first parent (meaning,
   read-tree trivial collapsing helped majorly).  Among them,
   the number of paths that needed real file-level 3-way merges
   were even smaller (avg 1.96).
   All three of these points together is a fine demonstration
   that you designed git really right.
The samples were between these two commits:
commit 6693e74a16ef563960764bd963f1048392135c3c
Author: Linus Torvalds <torvalds@g5.osdl.org>
Date:   Tue Oct 25 20:40:09 2005 -0700
commit 388f7ef720a982f49925e7b4e96f216f208f8c03
Author: Linus Torvalds <torvalds@g5.osdl.org>
Date:   Fri Nov 11 09:26:39 2005 -0800
Previous: Junio C HamanoNext: Linus Torvalds
Message 38 of 58 in “Comments on recursive merge..”
  1. Linus TorvaldsNov 7, 2005
  2. Linus TorvaldsNov 7, 2005
  3. merge-recursive: Only print relevant rename messagesFredrik Kuivinen, Nov 7, 2005
  4. Junio C HamanoNov 7, 2005
  5. Fredrik KuivinenNov 9, 2005
  6. Fredrik KuivinenNov 7, 2005
  7. Junio C HamanoNov 8, 2005
  8. Linus TorvaldsNov 8, 2005
  9. Junio C HamanoNov 8, 2005
  10. Johannes SchindelinNov 8, 2005
  11. Fredrik KuivinenNov 8, 2005
  12. Junio C HamanoNov 8, 2005
  13. Linus TorvaldsNov 8, 2005
  14. Fredrik KuivinenNov 8, 2005
  15. Linus TorvaldsNov 8, 2005
  16. Johannes SchindelinNov 8, 2005
  17. Linus TorvaldsNov 9, 2005
  18. Junio C HamanoNov 9, 2005
  19. Petr BaudisNov 9, 2005
  20. Linus TorvaldsNov 9, 2005
  21. Junio C HamanoNov 9, 2005
  22. Linus TorvaldsNov 9, 2005
  23. Junio C HamanoNov 9, 2005
  24. Junio C HamanoNov 9, 2005
  25. Petr BaudisNov 9, 2005
  26. Linus TorvaldsNov 9, 2005
  27. Junio C HamanoNov 9, 2005
  28. Linus TorvaldsNov 9, 2005
  29. Junio C HamanoNov 9, 2005
  30. Linus TorvaldsNov 9, 2005
  31. merge-base: fully contaminate the well.Junio C Hamano, Nov 11, 2005
  32. Linus TorvaldsNov 11, 2005
  33. Junio C HamanoNov 11, 2005
  34. Linus TorvaldsNov 11, 2005
  35. Junio C HamanoNov 11, 2005
  36. Johannes SchindelinNov 8, 2005
  37. Make git-recursive the default strategy for git-pull.Junio C Hamano, Nov 8, 2005
  38. Junio C HamanoNov 11, 2005
  39. Linus TorvaldsNov 11, 2005
  40. Junio C HamanoNov 12, 2005
  41. Ryan AndersonNov 12, 2005
  42. GIT commit statistics.Junio C Hamano, Nov 12, 2005
  43. Martin LanghoffNov 12, 2005
  44. Petr BaudisNov 12, 2005
  45. Catalin MarinasNov 15, 2005
  46. Chuck LeverNov 15, 2005
  47. Johannes SchindelinNov 12, 2005
  48. Junio C HamanoNov 13, 2005
  49. Martin LanghoffNov 13, 2005
  50. Junio C HamanoNov 14, 2005
  51. Martin LanghoffNov 14, 2005
  52. Junio C HamanoNov 14, 2005
  53. Martin LanghoffNov 14, 2005
  54. Petr BaudisNov 14, 2005
  55. Martin LanghoffNov 14, 2005
  56. Junio C HamanoNov 14, 2005
  57. Junio C HamanoNov 15, 2005
  58. Petr BaudisNov 13, 2005

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.