coherent-oss / system

4 stars 0 forks source link

Considering a repo compatibility strategy #9

Open jaraco opened 5 months ago

jaraco commented 5 months ago

It occurred to me that despite the design of the essential layout, it might be possible to provide a compatible view of the repo that mimics the flat layout (or maybe the src layout) by leveraging subrepos (i.e. Git submodules).

And it makes me wonder, can a repo have a submodule into itself? I'm imagining something like:

In the main branch, store the code in the essential layout. In another branch, which I've yet to name, but maybe full or merged, it would have all of the ancillary details manifest (perhaps by tooling) and then link to the code in a src layout or flat layout:

 tempora merged @ tree
.
├── LICENSE
├── NEWS.rst
├── ...
├── pyproject.toml
├── pytest.ini
├── ruff.toml
├── tempora -> https://github.com/jaraco/tempora@main
├── towncrier.toml
└── tox.ini

This approach could provide a compatibility layer and branch where the ancillary details could be statically manifest for tools that require them (such as pip install from repo).

jaraco commented 5 months ago

See https://github.com/jaraco/tempora/tree/experiment/full for an example, which I created by running the commands:

$ git checkout -b experiment/full
$ git rm -r docs tempora tests
$ git commit ...
$ git submodule add --force --branch experiment/coherent gh://jaraco/tempora
$ git commit ...