* how do I merge completely unrelated repositories ? @ 2008-06-26 9:39 Christian MICHON 2008-06-26 9:45 ` Miklos Vajna 2008-06-26 11:04 ` Jakub Narebski 0 siblings, 2 replies; 9+ messages in thread From: Christian MICHON @ 2008-06-26 9:39 UTC (permalink / raw) To: Git Mailing List Hi, I'd like to create a new empty repository and merge into it 2 completely unrelated remote repositories. How would you do it, since merge will not merge if it cannot find a common ancestor ? -- Christian -- http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside ! ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: how do I merge completely unrelated repositories ? 2008-06-26 9:39 how do I merge completely unrelated repositories ? Christian MICHON @ 2008-06-26 9:45 ` Miklos Vajna 2008-06-26 10:51 ` Christian MICHON 2008-06-26 11:25 ` Johannes Schindelin 2008-06-26 11:04 ` Jakub Narebski 1 sibling, 2 replies; 9+ messages in thread From: Miklos Vajna @ 2008-06-26 9:45 UTC (permalink / raw) To: Christian MICHON; +Cc: Git Mailing List [-- Attachment #1: Type: text/plain, Size: 317 bytes --] On Thu, Jun 26, 2008 at 11:39:37AM +0200, Christian MICHON <christian.michon@gmail.com> wrote: > How would you do it, since merge will not merge if it cannot find a > common ancestor ? Did you try so? If there are no conflicting paths then a simple git pull /path/to/other/repo.git master or similar should work. [-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: how do I merge completely unrelated repositories ? 2008-06-26 9:45 ` Miklos Vajna @ 2008-06-26 10:51 ` Christian MICHON 2008-06-26 11:25 ` Johannes Schindelin 1 sibling, 0 replies; 9+ messages in thread From: Christian MICHON @ 2008-06-26 10:51 UTC (permalink / raw) To: Miklos Vajna; +Cc: Git Mailing List On Thu, Jun 26, 2008 at 11:45 AM, Miklos Vajna <vmiklos@frugalware.org> wrote: > On Thu, Jun 26, 2008 at 11:39:37AM +0200, Christian MICHON <christian.michon@gmail.com> wrote: >> How would you do it, since merge will not merge if it cannot find a >> common ancestor ? > > Did you try so? yes I did. it was failing. > > If there are no conflicting paths then a simple > > git pull /path/to/other/repo.git master pull = fetch + merge maybe I was not fetching the objects properly. > > or similar should work. > your hint works fine. thanks! I was starting considering rebasing the 2 repos on a common empty commit (that would have been desperate)... -- Christian -- http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside ! ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: how do I merge completely unrelated repositories ? 2008-06-26 9:45 ` Miklos Vajna 2008-06-26 10:51 ` Christian MICHON @ 2008-06-26 11:25 ` Johannes Schindelin 2008-06-26 12:19 ` Miklos Vajna 2008-06-26 16:19 ` Oliver Kullmann 1 sibling, 2 replies; 9+ messages in thread From: Johannes Schindelin @ 2008-06-26 11:25 UTC (permalink / raw) To: Miklos Vajna; +Cc: Christian MICHON, Git Mailing List Hi, On Thu, 26 Jun 2008, Miklos Vajna wrote: > On Thu, Jun 26, 2008 at 11:39:37AM +0200, Christian MICHON <christian.michon@gmail.com> wrote: > > How would you do it, since merge will not merge if it cannot find a > > common ancestor ? > > Did you try so? > > If there are no conflicting paths then a simple > > git pull /path/to/other/repo.git master > > or similar should work. FWIW this is how gitk got into git.git... See 5569bf9b(Do a cross-project merge of Paul Mackerras' gitk visualizer). This also was often referred to as the "coolest merge ever". Ciao, Dscho ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: how do I merge completely unrelated repositories ? 2008-06-26 11:25 ` Johannes Schindelin @ 2008-06-26 12:19 ` Miklos Vajna 2008-06-26 16:19 ` Oliver Kullmann 1 sibling, 0 replies; 9+ messages in thread From: Miklos Vajna @ 2008-06-26 12:19 UTC (permalink / raw) To: Johannes Schindelin; +Cc: Christian MICHON, Git Mailing List [-- Attachment #1: Type: text/plain, Size: 456 bytes --] On Thu, Jun 26, 2008 at 12:25:54PM +0100, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote: > FWIW this is how gitk got into git.git... See 5569bf9b(Do a cross-project > merge of Paul Mackerras' gitk visualizer). This also was often referred > to as the "coolest merge ever". If we are at it, that's not unique, there are other root commits as well: 2744b23 - git-tools, 161332a - gitweb, cb07fc2 - git-gui, 16d6b8a - p4-fast-export. ;-) [-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: how do I merge completely unrelated repositories ? 2008-06-26 11:25 ` Johannes Schindelin 2008-06-26 12:19 ` Miklos Vajna @ 2008-06-26 16:19 ` Oliver Kullmann 2008-06-26 18:26 ` Asheesh Laroia 2008-06-26 18:42 ` Kelly F. Hickel 1 sibling, 2 replies; 9+ messages in thread From: Oliver Kullmann @ 2008-06-26 16:19 UTC (permalink / raw) To: git Hi, since a similar question burdens my soul for quite some time, I would like to take the opportunity to extend the question a bit: I have around 10 CVS repositories, each with around 5 modules. This has developed over time, and now I want to combine them all into a single Git repository, with a new directory structure introduced. One possibility would be to convert these 50 CVS modules into git repositories, then for each of these git repositories introduce the new tree structure (that is, what is relevant for this part), move all files to their new location (via "git mv"), and finally pull everything in into the common repository. This is all fine, except of the inability to follow the history nicely (for example, via gitk I will only see the history from the point on where in those temporary git-repositories the files have been moved to their new place). To avoid this break in the history, it would be great if cvsimport could already move the files to the right place in the directory hierarchy, that is, if an additional parameter P could be given, the initial path, and files will be imported as P/file. Then I could import everything right away into the final git repository, without problems with clashes. I can't find something like that in the documentation. Is there perhaps some other possibility? It seems easiest to me to do this little bit of surgery at the time of the import, before git gets into his troubles with hash-values. thanks! Oliver On Thu, Jun 26, 2008 at 12:25:54PM +0100, Johannes Schindelin wrote: > Hi, > > On Thu, 26 Jun 2008, Miklos Vajna wrote: > > > On Thu, Jun 26, 2008 at 11:39:37AM +0200, Christian MICHON <christian.michon@gmail.com> wrote: > > > How would you do it, since merge will not merge if it cannot find a > > > common ancestor ? > > > > Did you try so? > > > > If there are no conflicting paths then a simple > > > > git pull /path/to/other/repo.git master > > > > or similar should work. > > FWIW this is how gitk got into git.git... See 5569bf9b(Do a cross-project > merge of Paul Mackerras' gitk visualizer). This also was often referred > to as the "coolest merge ever". > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: how do I merge completely unrelated repositories ? 2008-06-26 16:19 ` Oliver Kullmann @ 2008-06-26 18:26 ` Asheesh Laroia 2008-06-26 18:42 ` Kelly F. Hickel 1 sibling, 0 replies; 9+ messages in thread From: Asheesh Laroia @ 2008-06-26 18:26 UTC (permalink / raw) To: Oliver Kullmann; +Cc: git On Thu, 26 Jun 2008, Oliver Kullmann wrote: > I have around 10 CVS repositories, each with around 5 modules. This has > developed over time, and now I want to combine them all into a single > Git repository, with a new directory structure introduced. I had a similar desire with git-svn; instead, what I do is a git-filter-branch that renames all the files in the repository. man git-filter-branch gives you one way to do that; I basically re-invented that due to not scrolling all the way to the bottom, and run it every night on the git-svn repo since I want my everything-renamed repo to be kept as an up-to-date mirror of the svn repo. That's my idea for you. -- Asheesh. -- Fast, cheap, good: pick two. ^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: how do I merge completely unrelated repositories ? 2008-06-26 16:19 ` Oliver Kullmann 2008-06-26 18:26 ` Asheesh Laroia @ 2008-06-26 18:42 ` Kelly F. Hickel 1 sibling, 0 replies; 9+ messages in thread From: Kelly F. Hickel @ 2008-06-26 18:42 UTC (permalink / raw) To: Oliver Kullmann, git > -----Original Message----- > From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On > Behalf Of Oliver Kullmann > Sent: Thursday, June 26, 2008 11:20 AM > To: git@vger.kernel.org > Subject: Re: how do I merge completely unrelated repositories ? > > Hi, > > since a similar question burdens my soul for quite some > time, I would like to take the opportunity to extend > the question a bit: > > I have around 10 CVS repositories, each with around 5 modules. > This has developed over time, and now I want to combine them > all into a single Git repository, with a new directory > structure introduced. > > One possibility would be to convert these 50 CVS modules > into git repositories, then for each of these git repositories > introduce the new tree structure (that is, what is relevant > for this part), move all files to their new location (via > "git mv"), and finally pull everything in into the common > repository. > > This is all fine, except of the inability to follow the history > nicely (for example, via gitk I will only see the history > from the point on where in those temporary git-repositories > the files have been moved to their new place). > > To avoid this break in the history, it would be great if > cvsimport could already move the files to the right place > in the directory hierarchy, that is, if an additional > parameter P could be given, the initial path, and files > will be imported as P/file. Then I could import everything right away > into > the final git repository, without problems with clashes. > I can't find something like that in the documentation. > > Is there perhaps some other possibility? > It seems easiest to me to do this little bit of surgery > at the time of the import, before git gets into his > troubles with hash-values. > > thanks! > > Oliver > > Oliver, I wrote a little (314 line) perl script to blend multiple cvsps output streams together before handing them to git-cvsimport, it seems to work fine. It should (but I haven't tested it) even still allow the incremental approach. Not sure if I should just attach it here (it's not that big, but still), but if you need/want a copy of "cvsps_blender.pl", just send me an email and I'll send it out.... -Kelly ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: how do I merge completely unrelated repositories ? 2008-06-26 9:39 how do I merge completely unrelated repositories ? Christian MICHON 2008-06-26 9:45 ` Miklos Vajna @ 2008-06-26 11:04 ` Jakub Narebski 1 sibling, 0 replies; 9+ messages in thread From: Jakub Narebski @ 2008-06-26 11:04 UTC (permalink / raw) To: git Christian MICHON wrote: > I'd like to create a new empty repository and merge into it 2 > completely unrelated remote repositories. > > How would you do it, since merge will not merge if it cannot find a > common ancestor ? The problem probably is _empty_ repository (what do you want to merge), not lack of common ancestors. git.git repository has joined unrelated projects (git-mail-tools, gitweb, gitk, git-gui) and it has several roots, and even a few separate branches. -- Jakub Narebski Warsaw, Poland ShadeHawk on #git ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-06-26 18:43 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-06-26 9:39 how do I merge completely unrelated repositories ? Christian MICHON 2008-06-26 9:45 ` Miklos Vajna 2008-06-26 10:51 ` Christian MICHON 2008-06-26 11:25 ` Johannes Schindelin 2008-06-26 12:19 ` Miklos Vajna 2008-06-26 16:19 ` Oliver Kullmann 2008-06-26 18:26 ` Asheesh Laroia 2008-06-26 18:42 ` Kelly F. Hickel 2008-06-26 11:04 ` Jakub Narebski
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).