Maintaining project with plugins in git

后端 未结 1 733
不思量自难忘°
不思量自难忘° 2021-01-14 07:02

We are currently using SVN to develop an internal application that has most of its functionality in plugins. In our approach to switch git, this app is causing some headache

1条回答
  •  礼貌的吻别
    2021-01-14 07:20

    This kind of system (as in "collection of writable components") would be best managed with:

    • each plugin in its own repository
    • one parent project which would declare all the relevant plugins as submodules.

    As detailed in "true nature of submodules", you can then modify any plugin directly from that one parent project.
    (See also Duplicate submodules with Git if you have duplicate dependencies) And recent Git releases comes with commands able to recursively checkout all the submodules of a parent project.


    So when I check the parent project out and remember to call "git submodule init" for each plugin, I would have all projects on my desktop.

    But you shouldn't have to remember to do anything beside git submodule update --init --recursive (just one command). As I said, it will recursively initialize all your submodules.

    However submodules are pinned to versions, wouldn't this cause some more complicated workflow?

    The principle of dependency management is to always reference a specific version (as opposed to reference "the latest code out there" for one component).
    But that doesn't prevent you to:

    • work in that component (working from that specific version *as a starting point")
    • commit
    • push that one component to its remote repo
    • go up one level, back in the parent project
    • commit the parent project (in order to reference the new version of the submodule you just modified)

    Again, true nature of submodules details that process.

    0 讨论(0)
提交回复
热议问题