Replies: 1 comment
-
After giving it a good though, I think I'd rather go with the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Originally this question was started by @ankurvdev:
Let me extend this conversation to using one of the:
git submodule
It is generally convenient/usable to use submodules by my experience, but it has at least one big drawback:
git submodule
support is not always present in the project's environment. And the fact that aftergit clone/pull
you have to performgit submodule
init
/update
and, possibly,--recursive
is also a bit unconvenience.There are other reasons why people can't or don't like using it and I generally understand those reasons.
git subtree
I'll only name one big plus of this aproach (in scope for libusb-cmake project): it would make a single solid repository.
But, there is "but"s:
git subtree
can only be done in a sub-folder, ie it is not possible to have agit subtree
in the root of the repo.A history of a subtree might leak into the main project, i.e. when doing a subtree update with missing
--squash
. I don't believe git history of a subtree should be a part of the main project in our case and it is just an additional step/check a maintainer has to perform.It is possible to commit into a subtree locally (in the context of a main project). Some may think that is a good thing (i.e. to to fix some small thing w/o needing to update the upstream), but I can imagine when it could go too far, may case further merge conflicts, and essentially - how different would it be from a fork?
"Random people from the internet" might simply confuse you with the upstream project and start opening bugs/issues/suggesting PRs that are unrelated to the main project.
I'd summarize all of those - it requires some level of discipline from the maintainer and contributors to make things nice long-term.
CMake FetchContent
For those who don't know what is it: https://cmake.org/cmake/help/latest/module/FetchContent.html
My biggest consern with it - it would fetch the upstream subproject at a CMake
configuration time
, i.e. it might be the issue for projects that practice something like "internet connection allowed only during thegit clone
stage" or so.It is also harder to poke-around in the source code of the subproject locally during the main project development, if you need to (i.e. need to configure CMake/IDE to show the content of the fetched subfolder).
Beside those conserns, I'd say that I like this aproach the most.
I'd like to hear alternative opinions on this.
Beta Was this translation helpful? Give feedback.
All reactions