{"thread":{"id":"15649","subject":"Partial tree export and merging","startedAt":"2008-09-24T13:58:07Z","lastAt":"2008-09-25T14:51:10Z","messageCount":7,"participants":["Heiko Voigt","Shawn O. Pearce","Nguyen Thai Ngoc Duy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"91465","messageId":"48DA476F.1070700@mahr.de","threadId":"15649","inReplyTo":"48D9FACB.20901@mahr.de","subject":"Partial tree export and merging","fromName":"Heiko Voigt","fromEmail":"heiko.voigt@mahr.de","sentAt":"2008-09-24T13:58:07Z","receivedAt":"2008-09-24T13:58:07Z","isPatch":false,"sender":{"key":"heiko.voigt@mahr.de","avatar":null},"body":"Hallo,\n\nI am currently facing a challenge for adding limited access to a git \nrepository for the i18n and documentation (language) team. Our \nrepository contains *.html and *.loc files which are located along with \nthe code. The language team should not see the code. At the same time a \ndeveloper using the full tree needs to be able to contribute to the i8n \nfiles.\n\nTo archieve this I would like to extract a repository that only contains \nthe documentation and localization files which can be used by the i8n \nand doc team. This should be regularly merged into the development (with \ncode) repository.\n\nMy idea of a solution would be to export patches only for the specific \nfiles and import them into a seperate empty repository/branch using \ngit-format-patch and git-am. This seperate repository then itself then\ncould be imported again with a normal merge operation. Has a anyone \nalready solved such a problem or other ideas how to solve this ?\n\ncheers Heiko\n"},{"id":"91466","messageId":"20080924143945.GN3669@spearce.org","threadId":"15649","inReplyTo":"48DA476F.1070700@mahr.de","subject":"Re: Partial tree export and merging","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-09-24T14:39:45Z","receivedAt":"2008-09-24T14:39:45Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Heiko Voigt <heiko.voigt@mahr.de> wrote:\n>\n> I am currently facing a challenge for adding limited access to a git  \n> repository for the i18n and documentation (language) team.\n...\n> To archieve this I would like to extract a repository that only contains  \n> the documentation and localization files which can be used by the i8n  \n> and doc team. This should be regularly merged into the development (with  \n> code) repository.\n>\n> My idea of a solution would be to export patches only for the specific  \n> files and import them into a seperate empty repository/branch using  \n> git-format-patch and git-am. This seperate repository then itself then\n> could be imported again with a normal merge operation. Has a anyone  \n> already solved such a problem or other ideas how to solve this ?\n\nSee git-filter-branch.  You can use it to slice the history down\nto only contain these files, but still show the full change history\nof them (assuming that is what you are trying to get).\n\nOnce the history is split into a new \"doc+html\" repository have\ndevelopers _only_ edit the docs/html in the doc+html repository,\ndon't make more edits in the source code repository.\n\nYou can use git-submodule or git-merge with the subtree strategy\nto pull changes from the doc+html repository into the main source\nrepository.\n\n-- \nShawn.\n"},{"id":"91474","messageId":"48DA5737.4030909@mahr.de","threadId":"15649","inReplyTo":"20080924143945.GN3669@spearce.org","subject":"Re: Partial tree export and merging","fromName":"Heiko Voigt","fromEmail":"heiko.voigt@mahr.de","sentAt":"2008-09-24T15:05:27Z","receivedAt":"2008-09-24T15:05:27Z","isPatch":false,"sender":{"key":"heiko.voigt@mahr.de","avatar":null},"body":"Shawn O. Pearce schrieb:\n> Once the history is split into a new \"doc+html\" repository have\n> developers _only_ edit the docs/html in the doc+html repository,\n> don't make more edits in the source code repository.\n\nThe problem with committing into 2 repositories (only merging from one \nside) is that the docs/html also contain localization files which make \nit hard to work/test the code because localization strings are initially \nadded by the developers. They would then have to change in the 2nd repo \nand pull for testing.\n\n> You can use git-submodule or git-merge with the subtree strategy\n> to pull changes from the doc+html repository into the main source\n> repository.\n\nWould git submodule work with this kind of layout? Same folders \ncontaining different files. I thought submodules only work with \nsubdirectories which are itself a git repo.\n\ncheers Heiko\n"},{"id":"91476","messageId":"20080924151347.GP3669@spearce.org","threadId":"15649","inReplyTo":"48DA5737.4030909@mahr.de","subject":"Re: Partial tree export and merging","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-09-24T15:13:47Z","receivedAt":"2008-09-24T15:13:47Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Heiko Voigt <heiko.voigt@mahr.de> wrote:\n> Shawn O. Pearce schrieb:\n>> Once the history is split into a new \"doc+html\" repository have\n>> developers _only_ edit the docs/html in the doc+html repository,\n>> don't make more edits in the source code repository.\n>\n> The problem with committing into 2 repositories (only merging from one  \n> side) is that the docs/html also contain localization files which make  \n> it hard to work/test the code because localization strings are initially  \n> added by the developers. They would then have to change in the 2nd repo  \n> and pull for testing.\n\nI can see how that would be difficult.\n\nIn think you are faced with either restructuring your tree so that\nthe docs/html/localization files are all under a single subdirectory,\nor you have to keep splitting down the repository with something like\nfilter-branch (or your own tools) to update the localization tree.\n\nDoing the latter risks more merge conflicts for developers when they\npull changes back from the localization team.  Usually a developer\ndoesn't want to d3eal with merge conflicts from doc writers, and\nthey really don't want to deal with them in localized files if they\ncan't read/write that language.\n\n>> You can use git-submodule or git-merge with the subtree strategy\n>> to pull changes from the doc+html repository into the main source\n>> repository.\n>\n> Would git submodule work with this kind of layout? Same folders  \n> containing different files. I thought submodules only work with  \n> subdirectories which are itself a git repo.\n\nYou are correct, a submodule requires that everything in that\ndirectory be part of that submodule.  If your source tree has the\n\"submodule files\" spread all over, intermingled with sources,\nyou can't use submodule to manage them.\n\nTypically the recommendation is to organize your source tree more\nby functional responsibility, so you can delegate all files under\na single directory to the docs team.  The project scales better to\nmore staff, and its easier to avoid merge conflicts.\n\n-- \nShawn.\n"},{"id":"91499","messageId":"fcaeb9bf0809241051se24bcf7tb836d1b820e288d6@mail.gmail.com","threadId":"15649","inReplyTo":"48DA476F.1070700@mahr.de","subject":"Re: Partial tree export and merging","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2008-09-24T17:51:55Z","receivedAt":"2008-09-24T17:51:55Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On 9/24/08, Heiko Voigt <heiko.voigt@mahr.de> wrote:\n> Hallo,\n>\n>  I am currently facing a challenge for adding limited access to a git\n> repository for the i18n and documentation (language) team. Our repository\n> contains *.html and *.loc files which are located along with the code. The\n> language team should not see the code. At the same time a developer using\n> the full tree needs to be able to contribute to the i8n files.\n\nThat could be done with (under-developing) sparse checkout. Basically\nlanguage team's people do \"git clone --sparse-checkout='*.loc:*.html'\nyour-repo.git\". Then they only have *.loc and *.html files in working\ndirectory. When they commit, all other files are unchanged. Developers\nmerge to have updated *.log/html as usual.\n\nI have a question though: is language team allowed to checkout/modify\nfiles other than *.loc and *.html?\n-- \nDuy\n"},{"id":"91600","messageId":"48DBA1DF.3050502@mahr.de","threadId":"15649","inReplyTo":"fcaeb9bf0809241051se24bcf7tb836d1b820e288d6@mail.gmail.com","subject":"Re: Partial tree export and merging","fromName":"Heiko Voigt","fromEmail":"heiko.voigt@mahr.de","sentAt":"2008-09-25T14:36:15Z","receivedAt":"2008-09-25T14:36:15Z","isPatch":false,"sender":{"key":"heiko.voigt@mahr.de","avatar":null},"body":"Nguyen Thai Ngoc Duy schrieb:\n> That could be done with (under-developing) sparse checkout. Basically\n> language team's people do \"git clone --sparse-checkout='*.loc:*.html'\n> your-repo.git\". Then they only have *.loc and *.html files in working\n> directory. When they commit, all other files are unchanged. Developers\n> merge to have updated *.log/html as usual.\n\nWhere is that option ? Or are you suggesting me to implement it ?\n\n> I have a question though: is language team allowed to checkout/modify\n> files other than *.loc and *.html?\n\nWell in an ideal world they should only have access to the \"language\" \nfiles. But it is not crucial for us if they get access to the source. \nIts more an issue of user friendlyness. The revision control which is in \nplace at the moment does allow them to selectively check out those files.\n\nHeiko\n"},{"id":"91602","messageId":"fcaeb9bf0809250751x403a4b31vf05cdaba04563bbc@mail.gmail.com","threadId":"15649","inReplyTo":"48DBA1DF.3050502@mahr.de","subject":"Re: Partial tree export and merging","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2008-09-25T14:51:10Z","receivedAt":"2008-09-25T14:51:10Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On 9/25/08, Heiko Voigt <heiko.voigt@mahr.de> wrote:\n> Nguyen Thai Ngoc Duy schrieb:\n>\n> > That could be done with (under-developing) sparse checkout. Basically\n> > language team's people do \"git clone\n> --sparse-checkout='*.loc:*.html'\n> > your-repo.git\". Then they only have *.loc and *.html files in working\n> > directory. When they commit, all other files are unchanged. Developers\n> > merge to have updated *.log/html as usual.\n> >\n>\n>  Where is that option ? Or are you suggesting me to implement it ?\n\nAs I said, it is being developed. It should not be used in production\nenvironment yet but if you want to try, you can get it from here\n\nhttp://repo.or.cz/w/git/pclouds.git in branch sparse-checkout\n\n> > I have a question though: is language team allowed to checkout/modify\n> > files other than *.loc and *.html?\n> >\n>\n>  Well in an ideal world they should only have access to the \"language\"\n> files. But it is not crucial for us if they get access to the source. Its\n> more an issue of user friendlyness. The revision control which is in place\n> at the moment does allow them to selectively check out those files.\n\nThanks. Just wanted to know the scenario that sparse checkout could be used.\n-- \nDuy\n"}]}