2

I currently have a large (30K commits) SVN repository that I am in the process of converting to git. Our codebase currently has a common (Core) set of code, as well as two separate bases (Java and .NET). This allows us to share common code as well as having different languages for when we push a build to a customer who will only support one of the two languages.

The SVN repository currently makes heavy use of svn:externals to produce a specific layout upon checkout that uses the common code, as well as the language specific code.

A stripped down version of the repository layout is as follows:

Core
 +
 +-->classes
 +-->public_html
     +>admin
     +>web
       +>images
       +>javascript
       +>styles

 Java
 +
 +-->public_html
     +>web
       +>includes
       +>code


 .NET
 +
 +-->public_html
     +>web
       +>includes
       +>code

Currently when I checkout from trunk in SVN, I will get the above layout on disk, however if I checkout a subfolder (Java or .NET), svn:externals will give me the following layout:

Java/.NET
+>classes
+>public_html
  +>admin
  +>web
    +>code
    +>javascript
    +>images
    +>includes
    +>styles

This will also let me edit the code in that folder, and doing a checkin will commit to the correct places in the repository.

My question is whether this is going to be achievable in git, using sub-modules or some other method, or if we need to re-think our entire layout and how to achieve what we want when it comes to doing a checkout of a branch to create a build. If we can do this with sub-modules, should I be following the standard sub-modules tutorials, or is there something more in-depth that I should look at?

Thanks!

Dave
  • 137
  • 1
  • 6

1 Answers1

1

You won't get that exact directory structure with submodules, because each one will be in its own directory within the parent repo.
Ie, you would get

Java
 +
 +-->public_html
 *-->Core
       +
       +-->public_html

(Instead of one mixed 'public_html')

I would still recommend submodules (and you can make modification directly in them, as explained in the "True nature of submodules").
However keep in that git submodules are quite different from svn:externals.

Once you have checked-out the Java repo (with a reference in it to the Core repo), I would re-create the correct directory structure with symlinks (available on Unix or Windows).

Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283