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

Re: [PATCHv2 4/4] builtin/reset: add --recurse-submodules switch

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 19, 2017, 04:18 UTC
Message-ID
<xmqqfuh5av47.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170418213725.7901-5-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 9 quoted lines
> git-reset is yet another working tree manipulator, which should
> be taught about submodules.
>
> One use case of "git-reset" is to reset to a known good state,
> and dropping commits that did not work as expected.
>
> In that case one of the expected outcomes from a hard reset
> would be to have broken submodules reset to a known good
> state as well.  A test for this was added in a prior patch.

When "git reset --hard" at the top-level superproject updates a gitlink in the index to a commit that was different from what was checked out in the working tree of the submodule, what should happen? Do we reset the tip of the current branch in the submodule to point at the commit the index of the top-level records? Do we detach the HEAD in the submodule to point at the commit? Something else that is configurable? Or do we just run "git reset --hard" in each submodule (which may leave submodule's HEAD different from what is recorded in the index of the superproject)?

"... to a known good state as well" does not help answering the above.
Previous: Stefan BellerNext: Stefan Beller
Message 6 of 10 in “[PATCHv2 0/4] recursive submodules: git-reset!”
  1. Stefan BellerApr 18, 2017
  2. 1/4 entry.c: submodule recursing: respect force flag correctlyStefan Beller, Apr 18, 2017
  3. 2/4 submodule.c: uninitialized submodules are ignored in recursive commandsStefan Beller, Apr 18, 2017
  4. 3/4 submodule.c: submodule_move_head works with broken submodulesStefan Beller, Apr 18, 2017
  5. 4/4 builtin/reset: add --recurse-submodules switchStefan Beller, Apr 18, 2017
  6. Junio C HamanoApr 19, 2017
  7. Stefan BellerApr 19, 2017
  8. 4/4 builtin/reset: add --recurse-submodules switchStefan Beller, Apr 21, 2017
  9. Brandon WilliamsApr 20, 2017
  10. Stefan BellerApr 20, 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.