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

Re: maildir / read-tree trivial merging getting in the way?

From
Linus Torvalds <torvalds@osdl.org>
Date
Feb 14, 2006, 02:36 UTC
Message-ID
<Pine.LNX.4.64.0602131833110.3691@g5.osdl.org>
In-Reply-To
<7vy80ewu6n.fsf@assigned-by-dhcp.cox.net>
On Mon, 13 Feb 2006, Junio C Hamano wrote:
Show 7 quoted lines
> 
> That would be more naturally done by writing that thing in a
> more reasonable scripting language (not shell, but Perl or
> Python), call ls-tree three times, do whatever merge to come up
> with the final shape of the tree, and then construct the tree
> with a single invocation of "update-index --index-info", maybe
> even starting from an empty index file.

Exactly. Except that it probably makes sense to use "git-diff-tree" to try to avoid doing lots of unnecessary work in a script, if the normal case is that there's still a lot of stuff that hasn't changed.

So conceptually you would do three "git-ls-tree" invocations, but in _practice_ it's probably better to do just one "git-ls-tree", and then use "git-diff-tree" to basically generate the differences from that one ls-tree to the other cases of interest.

So start with the merge-base, for example, and then basically generate the "what changed" between the merge base and the two branch heads.

That was the plan for doing merges initially, it just turned out that doing them in the index made things easier.

			Linus
Previous: Ben CliffordNext: Linus Torvalds
Message 4 of 5 in “maildir / read-tree trivial merging getting in the way?”
  1. Ben CliffordFeb 14, 2006
  2. Junio C HamanoFeb 14, 2006
  3. Ben CliffordFeb 14, 2006
  4. Linus TorvaldsFeb 14, 2006
  5. Linus TorvaldsFeb 14, 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.