There are different ways to cope with different versions of projects, forks (like in github) or product lines (typically with a preprocessor)
They are not mutually exclusive, many projects use a mix of the two. Stefan wants to find out how systems are using the mix, and when they decide to do what.
The topic of the investigation is the Marlin 3D printer, which is C++ project with printer control software. It is highly configurable (140 features) and has been forked 1588 times, which is quite remarkable for a project that is only 4 years old. Stefan used a mixed method approach of analyzing data and interviewing fork owners.
All data is available!
How often are forks used?
Of the 1588 forks, 306 developers features! Forks seem to help people work on projects, as forks contributed to 58% of the commits. 200 forks only changes configuration files, so it is also a lightweight system to make a project yours. These were the good parts, there were also downsides. Propagation of bug fixes is scarce, in general very few forks (15%) take in changes, even if they are bug fixes. Forks also make it hard to see what is going on, and who is doing what. This is a known issue, related to the dangers of code cloning in general.
When do users prefer a fork over an ifdef and why?
Even in a heavy forked project like Marlin, still ifdefs are used. For example, for flexibility of different settings (for testing of their own printer) They are also using for optional features, or to cope with memory constraints.
When are changes integrated?
This is often the result of community work: features are discussed extensively before they are merged. It helps if your features are well-tested, especially when there are only a few maintainers, because they have to trust the fact that they can maintain the new features.