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