All of
 help / color / mirror / Atom feed
* The coolest merge EVER!
@ 2005-06-22 21:46 Linus Torvalds
  2005-06-23  0:12 ` Jon Seymour
  2005-06-24  0:44 ` Junio C Hamano
  0 siblings, 2 replies; 7+ messages in thread
From: Linus Torvalds @ 2005-06-22 21:46 UTC (permalink / raw)
  To: Git Mailing List

Ok, Junio had some cool octopus merges, but I just one-upped him.

I just merged the "gitk" repository into git, and I did it as a real git
merge, which means that I actually retained all the original gitk
repository information intact. IOW, it's not a "import the data" thing,
it's literally a merge of the two trees, and the result has two roots.

Now, the advantage of this kind of merge is that Paul's original gitk
repository is totally unaffected by it, yet because I now have his history
(and the exact same objects), the normal kind of git merge should work
fine for me to continue to import Paul's work - we have the common parent
needed to resolve all differences.

Now, I don't know how often this ends up being actually used in practice, 
but at least in theory this is a totally generic thing, where you create a 
"union" of two git trees. I did the union merge manually, but in theory it 
should be easy to automate, with simply something like

	git fetch <project-to-union-merge>
	GIT_INDEX_FILE=.git/tmp-index git-read-tree FETCH_HEAD
	GIT_INDEX_FILE=.git/tmp-index git-checkout-cache -a -u
	git-update-cache --add -- (GIT_INDEX_FILE=.git/tmp-index git-ls-files)
	git commit

(this is not exactly how I did it, but that's just because I'd never done
this before so I didn't think it through and I had some stupid extra steps
in between that were unnecessary).

Of course, in order for the union merge to work, the namespaces have to be
fit on top of each other with no clashes, otherwise future merges will be 
quite painful. In the case of gitk, Paul's repository only tracked that 
single file, so that wasn't a problem.

Anyway, you shouldn't notice anything new, except for the fact that "gitk" 
now gets automatically included with the base git distribution. And the 
git repository has two roots, but hey, git itself doesn't care.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-06-24 19:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-22 21:46 The coolest merge EVER! Linus Torvalds
2005-06-23  0:12 ` Jon Seymour
2005-06-23  0:24   ` Jeff Garzik
2005-06-24  0:44 ` Junio C Hamano
2005-06-24 11:54   ` Matthias Urlichs
2005-06-24 17:49     ` Daniel Barkalow
2005-06-24 19:22     ` Linus Torvalds

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.