Adding beman.infra as a dependency of beman.exemplar using git subtree or submodule

I miss the decision to use the option bemanmodules

This decision was reached during discussions at the most recent C++Now.

and a description how it works

See the README file here:

Yes, I know, but infra/tools/beman-submodule/beman-submodule at main · bemanproject/infra · GitHub cp the files into a git tree without ignore, submodule; what is the trick?

I’m not sure what you’re asking-- as stated in the README.md, the design of beman-submodule is simply to copy the entire tree of the child repository into the parent repository, without using git submodules or .gitignore-ing the files. The GitHub Actions CI ensures that the child repository’s files are kept in sync with its repository’s upstream commit hash as specified in the .beman_submodule configuration file.

bash-5.2$ cat .beman_submodule 
[beman_submodule]
remote=https://github.com/bemanproject/infra.git
commit_hash=b8137a68c4bb05e30ac619820fffc92ca7d9d3ca
bash-5.2$ pwd
/Users/clausklein/Workspace/cpp/beman-project/exemplar/infra
bash-5.2$ git status .
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean
bash-5.2$ git remote -v
claus	git@github.com:ClausKlein/exemplar.git (fetch)
claus	git@github.com:ClausKlein/exemplar.git (push)
nickelpro	https://github.com/nickelpro/exemplar.git (fetch)
nickelpro	https://github.com/nickelpro/exemplar.git (push)
origin	https://github.com/bemanproject/exemplar.git (fetch)
origin	https://github.com/bemanproject/exemplar.git (push)
bash-5.2$ git branch 
  develop
  feature/test-installed-package
* main
  modules-cml-overhaul
bash-5.2$ 

Those commands and outputs are as I would expect given the design of beman-submodule. Is there a different result that you were expecting in that output?

This kind of code-reuse is a big HACK.

In combination with cookiecutter, it is madness!

bash-5.2$ tree -d -L3 cookiecutter/
cookiecutter/
└── {{cookiecutter.project_name}}
    ├── examples
    ├── include
    │   └── beman
    ├── infra
    │   ├── cmake
    │   └── tools
    ├── src
    │   └── beman
    └── tests
        └── beman

12 directories
bash-5.2$ 

Hi @ClausKlein, I understand you have some strong technical reservations about this approach to code-reuse and its integration with cookiecutter.

As a reminder for everyone, our Code of Conduct encourages us to maintain a welcoming and constructive atmosphere. While passionate debate is welcome, using terms like “HACK” and “madness” can come across as dismissive and can shut down productive conversation.

Could you please rephrase your feedback to focus on the specific technical arguments? It would be incredibly helpful if you could detail why you believe this approach is problematic and perhaps suggest an alternative path you think would be more robust. We value your expertise, and a more detailed critique would benefit everyone.

This feature is a general source of problems and should not count. i.e.:

  • My company use mirrors of github projects to prevent internet access on CI.
    This are clones of the git repos, not the dynamic contents linke this archives.

  • The boost source archives contain no CMakeLists.txt?

  • CPM.cmake bootstrap does not work on a mirror!

So this github release archive can’t be used!