I have a somewhat complicated branching structure at work (at least for me). It is something like this:
Main | 1 | 2 | \ 3 \ Ver2 | 1 | \ 2 \ | ProjectA 3 | 1
There are 2 branches off of main. ‘Ver2’ which has everyone’s changes for the next version, and ‘ProjectA’ which is my work.
My question is: Is there a way to create a config spec that knows what has been merged so I get:
- Anything from ProjectA that has not been merged
- If the LATEST from ProjectA has been merged to Ver2, then get the LATEST from Ver2 branch
- If there is not a ProjectA branch, get from Ver2
- If there is no Ver2, get from MAIN
For example, in the above case, if I merged version 1 from ProjectA to version 2 in Ver2 branch, then I would want to see version 3 on Ver2. However, if I have not yet merged those files, I would want version 1 from ProjectA in my view.
You have to remember why you define a branch:
To isolate a development effort.
So to better manage your complex config spec, you should know precisely what role play the ‘main’ branch, v2 branch and project A branch.
V2 and project A, for instance, should be there for two different reasons.
If Project A is there to develop the current version of the project, merges to V2 branch should occur to allow for retrofitting some of the current developments to the V2 branch.
By that reasoning, you should not want to see ‘both’ in a same view: they represent two different set of files, V2 could include large refactorings with very different API.
However, should you insist on such a configuration, you could use the ability of moving a ‘MERGE_FROM_PA’ label: each time you merge some files from Project A to V2 branch, you set again the ‘MERGE_FROM_PA’ label for each merged file/directory, moving that label from previous V2 versions to their latest.
The config spec could be:
But then again, that would not make much sense.
You need to define the different development efforts you want to modelize, and then define a coherent workflow, allowing your config spec to focus only on one of those environments.