{"thread":{"id":"7955","subject":"how to filter a pull","startedAt":"2007-05-03T13:17:05Z","lastAt":"2007-05-04T13:13:22Z","messageCount":7,"participants":["marc.zonzon@gmail.com","Peter Baumann","Junio C Hamano","marc zonzon","Alex Riesen","Karl Hasselström"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"40960","messageId":"20070503131704.GA7036@kernoel.kernoel.fr","threadId":"7955","inReplyTo":null,"subject":"how to filter a pull","fromName":"","fromEmail":"marc.zonzon@gmail.com","sentAt":"2007-05-03T13:17:05Z","receivedAt":"2007-05-03T13:17:05Z","isPatch":false,"sender":{"key":"marc.zonzon@gmail.com","avatar":null},"body":"I'm a git beginner (and an old user of cvs, and more recently of\nsubversion, and occasionally of arch)\n\nI'm very pleased with the decentralized character of git and the ease\nto manage branches. But I have a usual problem that I don't know how\nto solve properly in git.\n\nI have projects that draw some parts from two or three other\nprojects. But it is usually some small part, that are included, and\npatched in my project. I want to follow the development of these fellow\nprojects.\n\nMy problem is that I can of course get a branch to host a copy of the\nproject (if the are under git I can clone and pull, if not I use the\nnative scm to import and commit in the branch). But now I cannot merge\nin my development branch as I include only a small part. \n\nI found no way to register that I copy these part. The only one I can think of,\nis to have a script to extract a sub branch  with only the appropriate\npart and then pull from it (or push to my project). \ni.e. I pull from the project (if git) or update in cvs, or ..., then I\nfilter to extract the appropiate part, then push to my development branch.\n\nBut I suppose there are a lot of cleaner way to do it. And moreover\nI'm quite sure that developers have met the same problem, and have solved it.\n\nSorry to ask such  a stupid question but \n(1) git naming itself stupid content tracker encourage dumb people\nlike me to ask stupid questions .\n(2) I tried to RTFM, but could not find the appropriate page.\n\nThank you for any hint.\n"},{"id":"40963","messageId":"20070503150752.GB6500@xp.machine.xx","threadId":"7955","inReplyTo":"20070503131704.GA7036@kernoel.kernoel.fr","subject":"Re: how to filter a pull","fromName":"Peter Baumann","fromEmail":"waste.manager@gmx.de","sentAt":"2007-05-03T15:07:52Z","receivedAt":"2007-05-03T15:07:52Z","isPatch":false,"sender":{"key":"waste.manager@gmx.de","avatar":null},"body":"On Thu, May 03, 2007 at 03:17:05PM +0200, marc.zonzon@gmail.com wrote:\n> I'm a git beginner (and an old user of cvs, and more recently of\n> subversion, and occasionally of arch)\n> \n> I'm very pleased with the decentralized character of git and the ease\n> to manage branches. But I have a usual problem that I don't know how\n> to solve properly in git.\n> \n> I have projects that draw some parts from two or three other\n> projects. But it is usually some small part, that are included, and\n> patched in my project. I want to follow the development of these fellow\n> projects.\n> \n> My problem is that I can of course get a branch to host a copy of the\n> project (if the are under git I can clone and pull, if not I use the\n> native scm to import and commit in the branch). But now I cannot merge\n> in my development branch as I include only a small part. \n> \n> I found no way to register that I copy these part. The only one I can think of,\n> is to have a script to extract a sub branch  with only the appropriate\n> part and then pull from it (or push to my project). \n> i.e. I pull from the project (if git) or update in cvs, or ..., then I\n> filter to extract the appropiate part, then push to my development branch.\n> \n> But I suppose there are a lot of cleaner way to do it. And moreover\n> I'm quite sure that developers have met the same problem, and have solved it.\n> \n> Sorry to ask such  a stupid question but \n> (1) git naming itself stupid content tracker encourage dumb people\n> like me to ask stupid questions .\n> (2) I tried to RTFM, but could not find the appropriate page.\n> \n> Thank you for any hint.\n\nPerhaps the newly added merge strategy subtree [1] could work. Or the\njust added subproject support, but this is very new and only the lowlevel machinery\nis implemented right now.\n\n-Peter\n\n[1]: http://git.kernel.org/?p=git/git.git;a=commit;h=68faf68938ee943fc251c702f2027e4dfda354db\n"},{"id":"40968","messageId":"7vwszpzs33.fsf@assigned-by-dhcp.cox.net","threadId":"7955","inReplyTo":"20070503150752.GB6500@xp.machine.xx","subject":"Re: how to filter a pull","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-03T18:21:04Z","receivedAt":"2007-05-03T18:21:04Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Peter Baumann <waste.manager@gmx.de> writes:\n\n> On Thu, May 03, 2007 at 03:17:05PM +0200, marc.zonzon@gmail.com wrote:\n\n>> I have projects that draw some parts from two or three other\n>> projects. But it is usually some small part, that are included, and\n>> patched in my project. I want to follow the development of these fellow\n>> projects.\n>> ...\n> Perhaps the newly added merge strategy subtree [1] could work. Or the\n> just added subproject support, but this is very new and only the lowlevel machinery\n> is implemented right now.\n\nI do not think subtree merge would work with this situation, as\nit is only for cases that one side of the merge represents a\ntree that is a subset of the tree of the other side of the\nmerge.  marc.zonzon's case does not fit the pattern.\n\nIf I were doing this 6 months from now, I would probably use\nsubproject to host the whole tree of other projects somewhere,\nadjust the build procedure of the primary project to borrow the whole of these other\nprojects not just subtree -- or have appropriate symlinks in the\nsuperproject that point into relevant subtrees in the\nsubprojects.\n\nIf I were doing this today, I would probably use separate\nrepositories, next to the primary project, to host the whole\ntree of other projects, adjust the build procedure of the\nprimary project to borrow the whole of these other projects not\njust subtree -- and/or have appropriate symlinks in the primary\nproject that point into relevant subtrees in the neighbouring\nrepositories that host these other projects.\n"},{"id":"40975","messageId":"71295b5a0705031232l3dc6a61dh7c0d7f993536fab7@mail.gmail.com","threadId":"7955","inReplyTo":"7vwszpzs33.fsf@assigned-by-dhcp.cox.net","subject":"Re: how to filter a pull","fromName":"marc zonzon","fromEmail":"marc.zonzon@gmail.com","sentAt":"2007-05-03T19:32:52Z","receivedAt":"2007-05-03T19:32:52Z","isPatch":false,"sender":{"key":"marc.zonzon@gmail.com","avatar":null},"body":"On 5/3/07, Junio C Hamano <junkio@cox.net> wrote:\n\n> If I were doing this 6 months from now, I would probably use\n> subproject to host the whole tree of other projects somewhere,\n> adjust the build procedure of the primary project to borrow the whole of these other\n> projects not just subtree -- or have appropriate symlinks in the\n> superproject that point into relevant subtrees in the\n> subprojects.\n>\n> If I were doing this today, I would probably use separate\n> repositories, next to the primary project, to host the whole\n> tree of other projects, adjust the build procedure of the\n> primary project to borrow the whole of these other projects not\n> just subtree -- and/or have appropriate symlinks in the primary\n> project that point into relevant subtrees in the neighbouring\n> repositories that host these other projects.\n>\nThank you for your explanations, I'm not sure to truly understand what\nyou propose, (I told you I'm a beginner and not amonq the  clever\nones!)\n\nDo you mean that I have to do the patches I do on the fellow project\nin the mirror directory, as to keep it as a link? It could be possible\nwhen the project is managed by git (with the drawback of adding an\nextra complexity to dereference the links in the repository when\narchiving a release, and a lot of problem to export to a public\nrepository) but is not a possibility when the other project is managed\nby an other scm.\n\nI don't understand neither the first solution 'borrow the whole project'.\nTo better explain the problem I give a practical case.\n\nI'm working to package software for openwrt arm-mipsel system. The\nwhole openwrt buildsystem is available under subversion, it is a big\ntree (not so huge than the kernel you are accustomed to!)\n\nI need in my packages to produce rc scripts and udev conf, hotplug\nscripts. They depends of the base rc functions of openwrt (int etc),\nthe config system (in lib/config), and the hotplug scripts\n(/etc/hotplug.d), and I need to patch some of these scripts.\nI would like to stay in sync with the development of openwrt, the\nchange in the patched files are quite frequent but usualy merge\neasily. Of course this is only one part of my dependencies, the main\ntree that is imported in my project is the original package that I\nmodify to tailor it to openwrt.\n\nMy problem is how to deal with this neither major nor minor dependency.\n\nThanks for taking time to answer.\n\nMarc\n"},{"id":"40980","messageId":"20070503203719.GA2755@steel.home","threadId":"7955","inReplyTo":"71295b5a0705031232l3dc6a61dh7c0d7f993536fab7@mail.gmail.com","subject":"Re: how to filter a pull","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-05-03T20:37:19Z","receivedAt":"2007-05-03T20:37:19Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"marc zonzon, Thu, May 03, 2007 21:32:52 +0200:\n> I need in my packages to produce rc scripts and udev conf, hotplug\n> scripts. They depends of the base rc functions of openwrt (int etc),\n> the config system (in lib/config), and the hotplug scripts\n> (/etc/hotplug.d), and I need to patch some of these scripts.\n> I would like to stay in sync with the development of openwrt, the\n> change in the patched files are quite frequent but usualy merge\n> easily. Of course this is only one part of my dependencies, the main\n> tree that is imported in my project is the original package that I\n> modify to tailor it to openwrt.\n\nIt looks like you need neither subproject nor partial checkouts\n(another Git-specific feature which is just about to come into\nexistence). Just manage everything in one repo. Git deals with large,\nbig and even huge repos splendidly. It's the monstrous repos which\nstill make problems, but people working on them.\n"},{"id":"41031","messageId":"20070504101329.GA16446@diana.vm.bytemark.co.uk","threadId":"7955","inReplyTo":"7vwszpzs33.fsf@assigned-by-dhcp.cox.net","subject":"Re: how to filter a pull","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-05-04T10:13:29Z","receivedAt":"2007-05-04T10:13:29Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-05-03 11:21:04 -0700, Junio C Hamano wrote:\n\n> If I were doing this today, I would probably use separate\n> repositories, next to the primary project, to host the whole tree of\n> other projects, adjust the build procedure of the primary project to\n> borrow the whole of these other projects not just subtree -- and/or\n> have appropriate symlinks in the primary project that point into\n> relevant subtrees in the neighbouring repositories that host these\n> other projects.\n\nIt should be straightforward (and efficient) to make a script that\ntakes an existing branch and makes a parallel branch that contains\nonly one subtree of the first branch. This derived branch can then be\nused as a subproject or whatever.\n\nOr is there some obvious reason why this wouldn't work, or would be\ninconvenient?\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"41053","messageId":"71295b5a0705040613m74215667w72db82e0bc2c1a58@mail.gmail.com","threadId":"7955","inReplyTo":"20070504101329.GA16446@diana.vm.bytemark.co.uk","subject":"Re: how to filter a pull","fromName":"marc zonzon","fromEmail":"marc.zonzon@gmail.com","sentAt":"2007-05-04T13:13:22Z","receivedAt":"2007-05-04T13:13:22Z","isPatch":false,"sender":{"key":"marc.zonzon@gmail.com","avatar":null},"body":"On 5/4/07, Karl Hasselström <kha@treskal.com> wrote:\n\n> It should be straightforward (and efficient) to make a script that\n> takes an existing branch and makes a parallel branch that contains\n> only one subtree of the first branch. This derived branch can then be\n> used as a subproject or whatever.\n>\n> Or is there some obvious reason why this wouldn't work, or would be\n> inconvenient?\n\nThis was my initial idea,  pull and filter!, but of course it is\nsomewhat a hack, you pull inside git, and filter outside git, I don't\nknow how to keep history, it seems that once filtered the origin of\nthe subtree is lost. But I lack of git proficiency, I have no\nexperience wich git core and mainly have used it at the user\n'porcelain' level.\nI have had some hope that there is some mean to forward the internal\nstate recording of the database state.\nThe solution proposed by alex does not seem to be an option, if you\ndraw from many projects, you cannot host the whole trees because some\nnodes are duplicates, and if they are outside your field you don't\nbother of merging them.\nMoreover I don't know how you mark what belongs to your small project\nisland, among this big ocean.\n\nSo if I have no further advice I think the wiser is to try the raw\nscript option, at least for the next 6 months the time to git, and my\nown proficiency to ripen..\n\nMarc\n"}]}