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

RE: Merge with git-pasky II.

From
BSBarry Silverman <barry@disus.com>
Date
Apr 15, 2005, 02:33 UTC
Message-ID
<000001c54163$85540150$6400a8c0@gandalf>
In-Reply-To
<Pine.LNX.4.58.0504141728590.7211@ppc970.osdl.org>
>>In particular, if you ever find yourself wanting to graft together two
>>different commit histories, that almost certainly is what you'd want

to >>do. Somebody might have arrived at the exact same tree some other way, >>starting with a 2.6.12 tar.ball or something, and I think we should at >>least support the notion of saying "these two totally unrelated commits >>actually have the same base tree, so let's merge them in "space" (ie data) >>even if we can't really sanely join them in "time" (ie "commits").

If this is true - then the tree-id's of the two commits would be identical, but the commit-id's wouldn't.

Does this imply that common ancestor lookup should work by comparing the tree-id's (space-wise the same) rather than the commit-ids (time-wise the same)?

-----Original Message-----
From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On
Behalf Of Linus Torvalds
Sent: Thursday, April 14, 2005 8:43 PM
To: Junio C Hamano
Cc: Petr Baudis; git@vger.kernel.org
Subject: Re: Merge with git-pasky II.
On Thu, 14 Apr 2005, Junio C Hamano wrote:
>
> You say "merge these two trees" above (I take it that you mean
> "merge these two trees, taking account of this tree as their
> common ancestor", so actually you are dealing with three trees),
Yes. We're definitely talking three trees.
Show 5 quoted lines
> and I am tending to agree with the notion of merging trees not
> commits.  However you might get richer context and more sensible
> resulting merge if you say "merge these two commits".  Since
> commit chaining is part of the fundamental git object model you
> may as well use it.

Yes and no. There are real advantages to using the commit state to just figure out the trees, and then at least have the _option_ to do the merge at a pure tree object.

In particular, if you ever find yourself wanting to graft together two different commit histories, that almost certainly is what you'd want to do. Somebody might have arrived at the exact same tree some other way, starting with a 2.6.12 tar.ball or something, and I think we should at least support the notion of saying "these two totally unrelated commits actually have the same base tree, so let's merge them in "space" (ie data) even if we can't really sanely join them in "time" (ie "commits").

I dunno.

And it's also a question of sanity. The fact is, we know how to make tree merges unambiguous, by just totally ignoring the history between them. Ie we know how to merge data. I am pretty damn sure that _nobody_ knows how

to merge "data over time". Maybe BK does. I'm pretty sure it actually takes the "over time" into account. But My goal is to get something that

works, and something that is reliable because it is simple and it has simple rules.

As you say:
> This however opens up another set of can of worms---it would
> involve not just three trees but all the trees in the commit
> chain in between.
Exactly.  I seriously believe that the model is _broken_, simply because
it gets too complicated. At some point it boils down to "keep it simple,
stupid".
>  That's when you start wondering if it would
> be better to add renames in the git object model, which is the
> topic of another thread.  I have not formed an opinion on that
> one myself yet.

I've not even been convinved that renames are worth it. Nobody has really given a good reason why.

There are two reasons for renames I can think of:
 - space efficiency in delta-based trees. This is a total non-issue for 
   git, and trying to explicitly track renames is going to cause _more_
   space to be wasted rather than less.
 - "annotate". Something git doesn't really handle anyway, and it has 
   little to do with renames. You can fake an annotate, but let's face
it, 
   it's _always_ going to be depending on interpreting a diff. In fact, 
   that ends up how traditional SCM's do it too - they don't really 
   annotate lines, they just interpret the diff.
   I think you might as well interpret the whole object thing. Git
_does_ 
   tell you how the objects changed, and I actually believe that a diff 
   that works in between objects (ie can show "these lines moved from
this
   file X to tjhat file Y") is a _hell_ of a lot more powerful than
   "rename"  is.
   So I'd seriously suggest that instead of worryign about renames,
people 
   think about global diffs that aren't per-file. Git is good at
limiting 
   the changes to a set of objects, and it should be entirely possible
to 
   think of diffs as ways of moving lines _between_ objects and not just
   within objects. It's quite common to move a function from one file to
   another - certainly more so than renaming the whole file.
   In other words, I really believe renames are just a meaningless
special 
   case of a much more interesting problem. Which is just one reason why
   I'm not at all interested in bothering with them other than as a
"data 
   moved" thing, which git already handles very well indeed.
So there,
		Linus
-
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: Linus TorvaldsNext: David Woodhouse
Message 21 of 130 in “Merge with git-pasky II.”
  1. Petr BaudisApr 14, 2005
  2. Christopher LiApr 13, 2005
  3. Petr BaudisApr 14, 2005
  4. Christopher LiApr 13, 2005
  5. Linus TorvaldsApr 14, 2005
  6. Christopher LiApr 14, 2005
  7. Paul JacksonApr 14, 2005
  8. Christopher LiApr 14, 2005
  9. Paul JacksonApr 14, 2005
  10. Junio C HamanoApr 14, 2005
  11. Linus TorvaldsApr 14, 2005
  12. Junio C HamanoApr 14, 2005
  13. Linus TorvaldsApr 14, 2005
  14. Junio C HamanoApr 14, 2005
  15. Petr BaudisApr 14, 2005
  16. Junio C HamanoApr 14, 2005
  17. Linus TorvaldsApr 14, 2005
  18. Junio C HamanoApr 14, 2005
  19. Petr BaudisApr 14, 2005
  20. Linus TorvaldsApr 15, 2005
  21. Barry SilvermanApr 15, 2005
  22. David WoodhouseApr 15, 2005
  23. Linus TorvaldsApr 15, 2005
  24. David WoodhouseApr 15, 2005
  25. C. Scott AnanianApr 15, 2005
  26. Linus TorvaldsApr 15, 2005
  27. Johannes SchindelinApr 16, 2005
  28. David WoodhouseApr 17, 2005
  29. Paul JacksonApr 15, 2005
  30. Simon FowlerApr 16, 2005
  31. David LangApr 16, 2005
  32. Simon FowlerApr 16, 2005
  33. Petr BaudisApr 16, 2005
  34. Simon FowlerApr 16, 2005
  35. Linus TorvaldsApr 16, 2005
  36. David LangApr 16, 2005
  37. Ingo MolnarApr 17, 2005
  38. Brad RobertsApr 17, 2005
  39. Ingo MolnarApr 17, 2005
  40. Ingo MolnarApr 17, 2005
  41. Linus TorvaldsApr 17, 2005
  42. Herbert XuApr 17, 2005
  43. Linus TorvaldsApr 17, 2005
  44. Herbert XuApr 17, 2005
  45. Petr BaudisApr 17, 2005
  46. Kenneth JohanssonApr 17, 2005
  47. Herbert XuApr 18, 2005
  48. Petr BaudisApr 18, 2005
  49. Linus TorvaldsApr 17, 2005
  50. Sanjoy MahajanApr 18, 2005
  51. Ingo MolnarApr 18, 2005
  52. Sanjoy MahajanApr 16, 2005
  53. Linus TorvaldsApr 16, 2005
  54. ls-tree enhancementsJunio C Hamano, Apr 15, 2005
  55. Petr BaudisApr 15, 2005
  56. Junio C HamanoApr 15, 2005
  57. David WoodhouseApr 15, 2005
  58. Ingo MolnarApr 15, 2005
  59. David WoodhouseApr 15, 2005
  60. Ingo MolnarApr 15, 2005
  61. David WoodhouseApr 15, 2005
  62. Johannes SchindelinApr 15, 2005
  63. Theodore Ts'oApr 15, 2005
  64. Linus TorvaldsApr 15, 2005
  65. David WoodhouseApr 15, 2005
  66. Linus TorvaldsApr 15, 2005
  67. Paul JacksonApr 15, 2005
  68. C. Scott AnanianApr 15, 2005
  69. Paul JacksonApr 15, 2005
  70. Christopher LiApr 14, 2005
  71. Petr BaudisApr 14, 2005
  72. Live Merging from remote repositoriesBarry Silverman, Apr 14, 2005
  73. Junio C HamanoApr 14, 2005
  74. Question about git process modelBarry Silverman, Apr 15, 2005
  75. Erik van KonijnenburgApr 14, 2005
  76. Petr BaudisApr 14, 2005
  77. Junio C HamanoApr 14, 2005
  78. Christopher LiApr 14, 2005
  79. Petr BaudisApr 14, 2005
  80. Christopher LiApr 14, 2005
  81. Christopher LiApr 14, 2005
  82. Christopher LiApr 14, 2005
  83. Junio C HamanoApr 15, 2005
  84. Christopher LiApr 14, 2005
  85. Junio C HamanoApr 15, 2005
  86. Christopher LiApr 15, 2005
  87. Junio C HamanoApr 15, 2005
  88. Petr BaudisApr 15, 2005
  89. Junio C HamanoApr 15, 2005
  90. Petr BaudisApr 15, 2005
  91. Junio C HamanoApr 15, 2005
  92. Junio C HamanoApr 15, 2005
  93. Linus TorvaldsApr 15, 2005
  94. Petr BaudisApr 14, 2005
  95. git mergePetr Baudis, Apr 14, 2005
  96. Linus TorvaldsApr 15, 2005
  97. Petr BaudisApr 15, 2005
  98. Linus TorvaldsApr 15, 2005
  99. Petr BaudisApr 15, 2005
  100. Linus TorvaldsApr 16, 2005
  101. Daniel BarkalowApr 16, 2005
  102. Linus TorvaldsApr 16, 2005
  103. Daniel BarkalowApr 16, 2005
  104. Linus TorvaldsApr 16, 2005
  105. Daniel BarkalowApr 16, 2005
  106. Paul JacksonApr 16, 2005
  107. Petr BaudisApr 16, 2005
  108. Junio C HamanoApr 15, 2005
  109. C. Scott AnanianApr 15, 2005
  110. Petr BaudisApr 15, 2005
  111. Junio C HamanoApr 15, 2005
  112. 1/2 merge-trees script for Linus gitJunio C Hamano, Apr 15, 2005
  113. 2/2 merge-trees script for Linus gitJunio C Hamano, Apr 15, 2005
  114. 3/2 merge-trees script for Linus gitJunio C Hamano, Apr 15, 2005
  115. Linus TorvaldsApr 16, 2005
  116. Junio C HamanoApr 16, 2005
  117. Linus TorvaldsApr 16, 2005
  118. Linus TorvaldsApr 16, 2005
  119. Junio C HamanoApr 16, 2005
  120. Byteorder fix for read-tree, new -m semantics version.Junio C Hamano, Apr 16, 2005
  121. 1/2 Add --stage to show-files for new stage dircache.Junio C Hamano, Apr 16, 2005
  122. 2/2 Add --stage to show-files for new stage dircache.Junio C Hamano, Apr 16, 2005
  123. Issues with higher-order stages in dircacheJunio C Hamano, Apr 16, 2005
  124. Junio C HamanoApr 17, 2005
  125. Linus TorvaldsApr 17, 2005
  126. Junio C HamanoApr 17, 2005
  127. Summary of "read-tree -m O A B" mechanismJunio C Hamano, Apr 17, 2005
  128. Linus TorvaldsApr 16, 2005
  129. Linus TorvaldsApr 16, 2005
  130. Junio C HamanoApr 16, 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.