RE: Suggestion
From: David Radcliffe <david.radcliffe_at_clockworkit.co.uk>
Date: Wed, 9 Jul 2014 13:14:39 +0100
Julian,
Thanks for considering my suggestion, and your detailed reply.
Yes, 'sparse branching' does nicely describe the effect I am trying to achieve. I do appreciate that any form of 'variants' is going to cause a management overhead.
The specific problems I'm trying to overcome are:
1. Parameter controlled functionality:
2. Conditional Compilation:
Maybe the question should be put to the SVN community, to see what other users feel about this?
I haven't had a chance to try implementing anything. If I get time, I might try the post-check-out script idea...
Thanks again, Dave Radcliffe
-----Original Message-----
Hi David.
Thank you for writing in with your suggestion. It took me a while to really grasp the essence of it, which I think is
Sparse branching at the granularity of text hunks
where by "branching" I just mean tracking parallel streams of development in some way.
Thinking about configuration management paradigms rather than the mechanism, the branching paradigm where you have observed the need for a different way of working, and where this probably makes the most sense, is what you describe as "different instances of an application (say for different customers)", which sounds like what I know as "variants". Variant branching is a form of divergent branching, as is release branching, but with variant branching you expect to maintain each of these streams in parallel with ongoing development, while keeping the differences between them. The ongoing development may involve making a development branch sometimes from the whole set of variants, or sometimes from just one variant. In other words, variant branching can be orthogonal to development- and release branching: it's another dimension on the branching graph.
Conditional compilation is one way to implement variants; full branches (as in Subversion) are another way; and you are proposing something that combines aspects of both as being a better way than either.
No matter what method is used to manage the variants, the overall complexity of configuration management is basically the same. The complexity, that is, of managing which bug fixes need to be applied to which configurations, how to share code between two similar configurations, tracking which configurations are in what state of development and testing, and so on. If you have many variants, some of which are perhaps related to each other in sub-groups, and if you have many feature branches and release branches, some of which perhaps branch the whole set of variants and some of which apply only to some specific variants, then the management is complex. That is its own level of complexity.
But let's look at what your suggestion *can* make simpler.
From a read-only point of view, what you propose is something like conditional compilation (e.g. '#if' in C code), except you want the non-compiled text to be entirely omitted from the working file. In that sense it is like branching. It is a form of "sparse" branching as only certain files, and certain hunks of text within each file, are specific to the branch, the rest being common to all branches (in this dimension of branching).
It seems to be this property -- sparse branching -- that could make the management simpler.
When you commit a change to the common code on one branch, that change immediately affects all the other branches as well. Unlike with full branching, the change is not gated through any separate process of merge/test/commit. That immediacy can be useful, but, when changing common code, often a developer is expected to test that all variants will still build and perhaps pass some tests. It would be useful to be able to generate all the variants without having to check in a change and check it out again. Presumably some sort of "svn variant-switch" function would be available to switch to another variant while keeping the local modifications in place -- at least if the local mods are in common code. If there are local mods in branch-specific code, this is harder, requiring another layer of temporary storage.
In comparison with
The developer also has the option of getting a "complete" checkout, but then that is not buildable so it's of limited use. But why not make this "complete" checkout be exactly defined by "#if" (or similar) parseable mark-up so that it can used to build one or many variants? Start thinking that way, and then the "single variant" checkout becomes more like a post-processing on the conditional compilation.
You sound unhappy with the mechanism and/or interface that Visual Studio provides for managing conditional compilation with '#if', describing it as "flaky". I don't really know what you mean by that. Is there something inherently wrong with that model of conditional compilation? What is the essence of the problem and what is needed for a better solution? Or is it just a poor implementation? (One useful thing is if you can grey-out or hide the code for other variants because it's not interesting most of the time. Some source code editors or IDEs will do that automatically for non-active #if clauses.)
What about editing and committing changes and merging fixes into multiple variants? How exactly is this made easier?
Have you ever tried your idea in any form? You could perhaps prototype it using '#if'
Anyway, I'd be happy to hear your further thoughts.
Regards,
- Julian
>________________________________
-----
|
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.