git/list[1] front-page[2] threads[3] people[4] search[5] about
 

"mixed" or "merged" submodules

From
STSim Tov <smntov@gmail.com>
Date
Jul 5, 2022, 20:35 UTC
Message-ID
<CA+X_a+z-=K5BfDpMiWAnnVma6ihh6kUXb84CCrHL5gte5WykMw@mail.gmail.com>
Hello,
here  https://stackoverflow.com/q/72770397/1876484
I asked this question:
I'm aware of git submodules which dwell each in its own separate directory.
1. But is there such thing as "mixed" submodules whose content is
"merged" together?
For instance:
- Submodule1 (path ./), consist of files `a.txt`, `b.txt` and
directory `C` with the file `1.txt`
- Submodule2 (path ./), consist of files `x.txt`, `y.txt` and
directory `C` with the file `2.txt`
- Resulting "mixed" repo of both submodules: files `a.txt`, `b.txt`,
`x.txt`, `y.txt` and directory `C` with the files `1.txt`, `2.txt`
2. If it is not implemented in git - is there a workaround to achieve this?
Here my use case:

Both submodules - independent libraries (collection of books as plain text files), which have same structure (directories = book categories). I want to present the combined parent git repository as full collection of books, while both projects evolve independently and do not overlap (in terms of file names = books).

I got a very detailed and informative answer. My question now - do you see any other practical use cases for such a feature? Would such a more general case of submodules be a good feature in git or not?

Thank you!
Next: Ævar Arnfjörð Bjarmason
Message 1 of 3 in “"mixed" or "merged" submodules”
  1. Sim TovJul 5, 2022
  2. Ævar Arnfjörð BjarmasonJul 6, 2022
  3. Sim TovJul 6, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.