Reputation: 4288
Hey guys. I have an app in Objective C (using xcode) that I would like to branch into two different versions-- lite and full. Would a VCS (ie GIT or SVN) work for this if I forked the main project? I'm not familiar with how forking works, but would any changes I make to the main project be merged with the forked lite project?
If not, what system would be best for keeping the code in sync between the two projects? My goal would be to keep this as automated as possible...
Upvotes: 0
Views: 123
Reputation: 2752
Pretty much all VCS support branching which you can use for "flavoring" your product. But beware, alot depends on how you implement changes on the file-level. Personally I would not use VCS for flavoring stuff. Application- or buildlevel configuration is mostly easier to maintain.
But here two examples for how things might come out.
Example for easy flavoring:
branch-full
- module 1
- module 2
- module 3
- module 4
- documentation-full
branch-lite
- module 1
- module 2
- purchase-module
- documentation-lite
What you are shipping in this case is mostly defined on directory-level. No module is modified but only added or removed. These two lists could be maintained in a build-file as easily, maybe requiering no VCS at all, but thats a different story.
Example for flavoring made hard (anti-pattern) (one source file in the lite-branch)
my generic code ...
...
...
my lite-specific code ...
...
...
my generic code ...
...
...
If you encounter a bug in GENERIC code but only within your lite-branch (because the bug may be somehow connected to your lite-functionality) you will have to fix and commit it in the lite-branch. You will have to either cherry-pick merge (and make compatible with the full-version) your single bugfix or not merge it back to the full version at all. The later option over time increases the "gap" between your lite and full version which in turn makes it harder to get updates from the "upstream"-full version in case of bigger developments on that side.
C
Upvotes: 4
Reputation: 4516
You could use either. I'm most familial with svn, but I think they both have the capacity. You would have a main and a lite branch.
SVN merges quite easily. Conflict resolution is quite simple.
I'm betting most will agree it's a good tool for this.
Upvotes: 1