{"thread":{"id":"21181","subject":"git svn with non-standard svn layout","startedAt":"2009-10-09T22:24:48Z","lastAt":"2009-10-14T06:33:50Z","messageCount":4,"participants":["Fabian Molder","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"124556","messageId":"loom.20091010T001433-536@post.gmane.org","threadId":"21181","inReplyTo":null,"subject":"git svn with non-standard svn layout","fromName":"Fabian Molder","fromEmail":"fm122@arcor.de","sentAt":"2009-10-09T22:24:48Z","receivedAt":"2009-10-09T22:24:48Z","isPatch":false,"sender":{"key":"fm122@arcor.de","avatar":null},"body":"Hello,\n\n- want to use git inside an huge SVN project\n --> so git-svn could do the job ..\n\n\n- I struggle with two things:\n   A) - the SVN project has an non-standard layout\n   B) - want to have (several) git's for just the (few) peaces I work on\n\nfor A)\n======\n- svn layout looks like this (simplified):\n  - trunk  (not really used, all interesting work in branches)\n  - branches\n    - r1.2\n     - development\n     - integration\n    - r1.3\n     - development\n     - integration\n    ...\n\n- inside development and integration is:\n       - xapplication1\n       - xapplication2\n       - xapplication3\n       ...\n       - aa\n        -bb\n         -cc\n          - zapplication1\n          - zapplication2\n          - zapplication3\n          ...\n\n- I created an simplified svn test (from scratch; import/repo/workdir) \n  via this bash-script:   http://pastebin.ca/1608231\n\nfor B)\n======\n- the svn repo is very huge, but I'm only interested in these dirs:\n         xapplication2/\n         aa/bb/cc/zapplication1\n- my objectives: \n   - have several local git's, just the ones I need:\n     --> xapplication2/.git\n     --> aa/bb/cc/zapplication1/.git\n\n\nI tried to use \"git config svn-remote.svn.branches\" to do this,\n please see in function \"do_git_svn\" in bash-script - but no success\n\nany hints appreciated \n\nregards,\nFabian\n"},{"id":"124590","messageId":"20091011070937.GC16264@dcvr.yhbt.net","threadId":"21181","inReplyTo":"loom.20091010T001433-536@post.gmane.org","subject":"Re: git svn with non-standard svn layout","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2009-10-11T07:09:37Z","receivedAt":"2009-10-11T07:09:37Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Fabian Molder <fm122@arcor.de> wrote:\n> Hello,\n> \n> - want to use git inside an huge SVN project\n>  --> so git-svn could do the job ..\n> \n> \n> - I struggle with two things:\n>    A) - the SVN project has an non-standard layout\n>    B) - want to have (several) git's for just the (few) peaces I work on\n> \n> for A)\n> ======\n> - svn layout looks like this (simplified):\n>   - trunk  (not really used, all interesting work in branches)\n>   - branches\n>     - r1.2\n>      - development\n>      - integration\n>     - r1.3\n>      - development\n>      - integration\n>     ...\n> \n> - inside development and integration is:\n>        - xapplication1\n>        - xapplication2\n>        - xapplication3\n>        ...\n>        - aa\n>         -bb\n>          -cc\n>           - zapplication1\n>           - zapplication2\n>           - zapplication3\n>           ...\n> \n> - I created an simplified svn test (from scratch; import/repo/workdir) \n>   via this bash-script:   http://pastebin.ca/1608231\n> \n> for B)\n> ======\n> - the svn repo is very huge, but I'm only interested in these dirs:\n>          xapplication2/\n>          aa/bb/cc/zapplication1\n> - my objectives: \n>    - have several local git's, just the ones I need:\n>      --> xapplication2/.git\n>      --> aa/bb/cc/zapplication1/.git\n\nHi Fabian,\n\nSince you don't want to track the entire repo and these seem like\nunrelated (history-wise) trees, you probably want the simplest cases:\n\n  git svn clone svn://example.com/path/to/xapplication2\n  git svn clone svn://example.com/path/to/aa/bb/cc/xapplication1\n\nThese commands are like doing the following with plain old svn:\n\n  svn co svn://example.com/path/to/xapplication2\n  svn co svn://example.com/path/to/aa/bb/cc/xapplication1\n\n> I tried to use \"git config svn-remote.svn.branches\" to do this,\n>  please see in function \"do_git_svn\" in bash-script - but no success\n\nsvn-remote.svn.branches and tags are really only for repos with\nstandard layouts.\n\n-- \nEric Wong\n"},{"id":"124631","messageId":"loom.20091011T205226-197@post.gmane.org","threadId":"21181","inReplyTo":"20091011070937.GC16264@dcvr.yhbt.net","subject":"Re: git svn with non-standard svn layout","fromName":"Fabian Molder","fromEmail":"fm122@arcor.de","sentAt":"2009-10-11T19:00:19Z","receivedAt":"2009-10-11T19:00:19Z","isPatch":false,"sender":{"key":"fm122@arcor.de","avatar":null},"body":"Eric Wong <normalperson <at> yhbt.net> writes:\n\n...\n> \n> Hi Fabian,\n> \n> Since you don't want to track the entire repo and these seem like\n> unrelated (history-wise) trees, you probably want the simplest cases:\n> \n>   git svn clone svn://example.com/path/to/xapplication2\n>   git svn clone svn://example.com/path/to/aa/bb/cc/xapplication1\n> \n> These commands are like doing the following with plain old svn:\n> \n>   svn co svn://example.com/path/to/xapplication2\n>   svn co svn://example.com/path/to/aa/bb/cc/xapplication1\n> \n> > I tried to use \"git config svn-remote.svn.branches\" to do this,\n> >  please see in function \"do_git_svn\" in bash-script - but no success\n> \n> svn-remote.svn.branches and tags are really only for repos with\n> standard layouts.\n> \n\nHello Eric,\n  hmm, understand,\n  but this just does an checkout to the working dir\n\n  the reason for using git is:\n    - work offline, with (at least read) access to all the svn branches\n    - have some more (privat, not commit back to svn) branches for experiments\n    - all the nice git stuff ..\nregards,\nFabian\n"},{"id":"124943","messageId":"20091014063350.GB17178@dcvr.yhbt.net","threadId":"21181","inReplyTo":"loom.20091011T205226-197@post.gmane.org","subject":"Re: git svn with non-standard svn layout","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2009-10-14T06:33:50Z","receivedAt":"2009-10-14T06:33:50Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Fabian Molder <fm122@arcor.de> wrote:\n> Eric Wong <normalperson <at> yhbt.net> writes:\n> > Hi Fabian,\n> > \n> > Since you don't want to track the entire repo and these seem like\n> > unrelated (history-wise) trees, you probably want the simplest cases:\n> > \n> >   git svn clone svn://example.com/path/to/xapplication2\n> >   git svn clone svn://example.com/path/to/aa/bb/cc/xapplication1\n> > \n> > These commands are like doing the following with plain old svn:\n> > \n> >   svn co svn://example.com/path/to/xapplication2\n> >   svn co svn://example.com/path/to/aa/bb/cc/xapplication1\n> > \n> > > I tried to use \"git config svn-remote.svn.branches\" to do this,\n> > >  please see in function \"do_git_svn\" in bash-script - but no success\n> > \n> > svn-remote.svn.branches and tags are really only for repos with\n> > standard layouts.\n> > \n> \n> Hello Eric,\n>   hmm, understand,\n>   but this just does an checkout to the working dir\n> \n>   the reason for using git is:\n>     - work offline, with (at least read) access to all the svn branches\n>     - have some more (privat, not commit back to svn) branches for experiments\n>     - all the nice git stuff ..\n\nSorry, not sure if I understood you the first time.  The pastie was\nhard to read on my screen (big fonts, low res).\n\nI think what you need is to match the number of globs (*) on\nboth the remote and local sides:\n\n  REMOTE=branches/*/*/aa/bb/cc/zapplication1\n  LOCAL=refs/remotes/svn/aa/bb/cc/zapplication1/*/*\n  git config svn-remote.svn.branches \"${REMOTE}:${LOCAL}\"\n\n  #---> matches all in svn repo and also creates subdirs\n#\n#  git config svn-remote.svn.branches \\\n#  \"branches/r*/development/aa/bb/cc/zapplication1:refs/remotes/svn/branches/*\"\n#\n  #--> Missing trailing '/' on left side of: 'branches/r*/development/aa/bb/cc/zapplication1' (branches/r)\n\nThe glob code is still a bit wonky, but it needs to be \"/*/\" (that is\n\"*\" must have a \"/\" or nothing, but not \"/r*/\"\n\nBut it looks like the example with 2 globs works.\n\n-- \nEric Wong\n"}]}