I am looking for a solution for having revision control on framework code and project code at the same time. If I am using a MVC framework, there may be specific directories where I should put my project code. I want to easily apply framework updates using revision control while still keeping project code under a separate repository.
The solution I have come up with is to clone the framework repo using git, and then create a mercurial repo on top of it, and creating .gitignores and .hgignores so that they don't pick up on each other's code.
My directory structure would in theory look something like this:
- Framework/ (git)
- Framework_Code/ (git)
- Models/ (git)
- projectModel.php (hg)
- Views/ (git)
- projectView.html (hg)
- Controllers/ (git)
- projectController.php (hg)
- Front_Controller.php (git)
Assuming I have the correct .gitignores and .hgignores, when there are framework updates I can do a simple
git pull
And when I need to commit project code I can do
hg commit
Is this a bad workflow? Are there any easier ways to set up something like this with either git or mercurial? I'm open to alternative solutions because this seems like something that someone smarter than me would have a solution for.
1 Answer 1
This is a bad idea.
We have a similar setup in my company, but we use Git only. We have it so that the framework and project code are in separate branches, and then you can commit/push/pull independently.
The project branch is based off of the framework branch. This is convenient because if you make updates to the framework branch, you can just cleanly merge those changes into the project branch.
-
What would happen if you made a framework change in your project branch, how does the merge other way happen?Drahcir– Drahcir01/17/2014 03:39:16Commented Jan 17, 2014 at 3:39
-
In that case, you would need to make the change in the framework branch first, and then merge it back into the project branch.Code Slinger– Code Slinger01/17/2014 03:58:55Commented Jan 17, 2014 at 3:58
framework_code
andModels
really both subfolders ofFramework
?