Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Organizing my own external libraries in revision control

I want to set up a SVN repository to "revision-control" my projects. Currently my workspace looks like this, and I intend to keep it like that:

\workspace
   \myPrj1
   \myPrj2
   \myLibBase 
   \myLibA
   \myLibB

myPrj1 is using myLibBase and myLibA. myPrj2 is using myLibBase and myLibB. I will have more Projects coming up, that will use the libraries. I've written and am writing the libraries myself. While I am working on any of the projects I constantly tried to improve not just the project but also the libraries: find bugs, add features, etc.

Now how do I organize this in a repository?

This is my idea, but is it the best solution?

  1. I will always use the workspace as the project root.
  2. I will always include the libraries a project is using in the snv project folder
  3. I will always have additional snv projects for the libraries

Then in the repository the above example would look like this:

\repository    
   \myPrj1 
       \myPrj1
       \myLibBase
       \myLibA
    \myProj2
       \myProj2
       \myLibBase
       \myLibB
    \myLibBase
       \myLibBase
    \myLibA
       \myLibA
    \myLibB
       \myLibB

Having it like this

...concerning the projects:

Whenever I check-in a working-copy of a project, I always have all sources, including the libraries check-in together. So when I check-out a revision, I always get all sources (including the libraries) as they were at the moment of the check-in.

...concerning the libraries:

Additionally I can check-in a working-copy of a library in the libraries svn project, when I think it is a nice and stable version. That version could then be checked-out when I create a new project.

Can somebody confirm that this is a good idea? Best practise? Is there a better approach? Can I find documentation/tutorials/.. on this topic? On the web? In a book?

like image 323
AudioDroid Avatar asked Dec 10 '25 13:12

AudioDroid


1 Answers

Seems this is what you're looking for: Externals

Excerpt: "Sometimes it is useful to construct a working copy that is made out of a number of different checkouts. For example, you may want different subdirectories to come from different locations in a repository or perhaps from different repositories altogether. You could certainly set up such a scenario by hand—using svn checkout to create the sort of nested working copy structure you are trying to achieve. But if this layout is important for everyone who uses your repository, every other user will need to perform the same checkout operations that you did."

It basically works the way you want. It's OK, and necessary, to have multiple copies of dependencies when you need them to be at different revisions for whatever reason.

like image 55
Ioan Avatar answered Dec 12 '25 02:12

Ioan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!