We have a very large ancient flat CVS repo with an example format as below. I have imported each subdir as its own git repo with full history.
.
├── liba
├── libb
├── libc
├── prog1
├── prog2
└── prog3
Lets say that the 3 programs use libraries in the following way:
.
├── prog1
│ ├── liba
│ └── libb
├── prog2
│ ├── libb
│ └── libc
└── prog3
├── liba
└── libc
Because CVS allows tagging part of the tree - we tag each library and program release with a version tag. eg liba_4x23
, prog3_2x22
.
We also tag the program with every version of library it uses at release (ie liba_3x19
libc_7x88
)
If we release a new version of the program without a library tag - the tag stays the earliest version of the program it was used.
Now due to the way the git import works - it actually ends up at the latest version of the program (not to worried about that though)
Git submodules seem to be a very good solution for this - a version of a program can be checked out and it pulls in all the right version of libraries as submodules.
Now since all current programs are at different releases of libraries - I would need to retrofit a submodule at a particular version.
prog1
is linked withlibb_4x50
prog2
is linked withlibb_4x70
Assuming libb_4x70
is latest version then the example of prog2
is easy
git checkout prog2
cd prog2
git submodule add libb
.... done
So how to add libb
tagged with version (not branched) 4x50
to prog1
?
Other advice appreciated if you have a better idea :-)
What we may also want to do is go back 3 version of the program and set the appropriate submodules for each version. For either backwards compatibility and also as an example to management on how it will work.