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

Re: [RFD] Long term plan with submodule refs?

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 9, 2017, 05:47 UTC
Message-ID
<xmqq7ev0j95t.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20171108172945.33c42a0e91b4ac494217b788@google.com>
Jonathan Tan <jonathantanmy@google.com> writes:
Show 7 quoted lines
> What if, in the submodule, we have a new ref backend that mirrors the
> superproject? When initializing the submodule, its original refs are not
> cloned at all, but instead virtual refs are used.
> ...
> These rules seem straightforward to me (although I have been working
> with Git for a while, so perhaps I'm not the best judge), and I think
> leads to a good workflow, as discussed below.
Indeed this is intriguing.
Show 7 quoted lines
> The above rules allow the following workflow:
>  - "checkout --recurse-submodules" the branch you want on the
>    superproject
>  - make whatever changes you want in each submodule
>  - commit each individual submodule (which updates the index of the
>    superproject), then commit the superproject (we can introduce a
>    commit --recurse-submodules to make this more convenient)

The "recurse" option would also give users an extra atomicity, and would not be merely for convenience; when a user wants to treat a superproject and its two submodules as if the combined whole were a single repository, there shouldn't be two separate commits in the history of the superproject only because two submodules made one commit each to work on a single theme that spans all of them.

Previous: Jonathan TanNext: Junio C Hamano
Message 9 of 16 in “git-status reports relation to superproject”
  1. 0/4 git-status reports relation to superprojectStefan Beller, Nov 8, 2017
  2. 1/4 remote, revision: factor out exclusive counting between two commitsStefan Beller, Nov 8, 2017
  3. 3/4 submodule.c: get superprojects gitlink valueStefan Beller, Nov 8, 2017
  4. 4/4 git-status: report reference to superprojectStefan Beller, Nov 8, 2017
  5. 2/4 submodule.c: factor start_ls_files_dot_dot out of get_superproject_working_treeStefan Beller, Nov 8, 2017
  6. Jonathan TanNov 8, 2017
  7. [RFD] Long term plan with submodule refs?Stefan Beller, Nov 9, 2017
  8. Jonathan TanNov 9, 2017
  9. Junio C HamanoNov 9, 2017
  10. Junio C HamanoNov 9, 2017
  11. Stefan BellerNov 9, 2017
  12. Jacob KellerNov 9, 2017
  13. Stefan BellerNov 9, 2017
  14. Jacob KellerNov 10, 2017
  15. Stefan BellerNov 10, 2017
  16. Jacob KellerNov 11, 2017

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.