Our repo at work has branch versions, branch names are like,

  • 1.0
  • 1.2
  • 1.4

We also have version-agnostic code we're creating now for a plugin system.

Currently there is a proposal to put this version agnostic code in the latest branch on the repo. Are there any cons this approach we should be considering? Is it problematic to say "plugins are found in the latest branch and work with all branches of the repo"? Are there any open source precidents for this?

  • If the new code is version-agnostic (and doesn't need to be in-tree with each version), why not create it as a separate module and/or library?
    – Jesusaur
    Commented Sep 29, 2023 at 0:00

1 Answer 1


It's likely that you'll eventually find that it will be impossible to keep the plugins truly version agnostic.

Somewhere along the line one version of the regular code will make an assumption about the plugins that happens to be correct in one version, but changes in a later version. Even if you fix all of your branches to work with newer versions of the plugins, historical commits in those branches won't work with the newest plugins. This can make it difficult to some kinds of debugging (eg: anything with git bisect).

Instead of having the plugins only in the latest branch, it might be better to have them in all of the branches, and have a policy that changes to the plugins happen only in the latest version branch, and are then "backported" to the older versions' branches by cherry-picking the plugin update commits.

However, the best is probably to move the plugins into a separate repo and either use a package manager or git submodules. Then each version branch can be explicit about which version of the plugins it works with.

  • the plugins will use feature checks against the products to see what functionality is enabled. that's the plan anyway. And we intend to test them against all supported versions of the product Commented Sep 20, 2023 at 23:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.