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

RE: Merge with git-pasky II.

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 15, 2005, 20:31 UTC
Message-ID
<Pine.LNX.4.58.0504151313450.7211@ppc970.osdl.org>
In-Reply-To
<000d01c541ed$32241fd0$6400a8c0@gandalf>
[ I'm cc'ing the git list even though Barry's question wasn't cc'd. 
  Because I think his question is interesting and astute per se, even
  if I disagree with the proposal ]
On Fri, 15 Apr 2005, Barry Silverman wrote:
>
> If git is totally project based, and each commit represents total state
> of the project, then how important is the intermediate commit
> information between two states. 
You need it in order to do further merges.
Show 6 quoted lines
> IE, Area maintainer has A1->A2->A3->A4->A5 in a repository with 5
> commits, and 5 comments. And I last synced with A1.
> 
> A few days later I sync again. Couldn't I just pull the "diff-tree A5
> A1" and then commit to my tree just the record A1->A5. Why does MY
> repository need trees A2,A3,A4?

Because that second merge needs the first merge to work well. The first merge might have had some small differences that ended up auto-merging (or even needing some manual help from you). The second time you sync, there migth be some more automatic merging. And so on.

If you don't keep track of the incremental merges, you end up with one really _difficult_ merge that may not be mergable at all. Not automatically, and perhaps not even with help.

So in order to keep things mergable, you need to not diverge. And the intermediate merges are the "anchor-points" for the next merge, keeping the divergences minimal.

I'm personally convinced that one of the reasons CVS is a pain to merge is obviously that it doesn't do a good job of finding parents, but also exactly _because_ it makes merges so painful that people wait longer to do them, so you never end up fixing the simple stuff. In contrast, if you have all these small merges going on all the time, the hope is that there's never any really painful nasty "final merge".

So you're right - the small merges do end up cluttering up the revision history. But it's a small price to pay if it means that you avoid having the painful ones.

> Isn't preserving the A1,A2,A3,A4,A5 a legacy of BK, which required all
> the changesets to be loaded in order, and so is a completely "file"
> driven concept? 

Nope. In fact, to some degree git will need this even _more_, since the git merger is likely to be _weaker_ than BK, and thus more easily confused.

I do believe that BK has these things for the same reason.
			Linus
Next: Barry Silverman
Message 1 of 3 in “RE: Merge with git-pasky II.”
  1. Linus TorvaldsApr 15, 2005
  2. Barry SilvermanApr 15, 2005
  3. Linus TorvaldsApr 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.