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

Re: Auto update submodules after merge and reset

From
Marc Branchaud <marcnarc@xiplink.com>
Date
Dec 14, 2011, 15:16 UTC
Message-ID
<4EE8BDD7.1080507@xiplink.com>
In-Reply-To
<4EE7DA2C.7000300@ursus.ath.cx>
On 11-12-13 06:05 PM, Andreas T.Auer wrote:
Show 14 quoted lines
> 
> On 13.12.2011 22:44 Jens Lehmann wrote:
>>
>>  If you follow a tip there won't be any new SHA-1s recorded during
>>  that following so you could not do a bisect and expect the submodule
>>  to be what the developer had when doing the commits, no?
> 
> If you never commit something to the superproject, you wouldn't get SHA1s
> recorded, that's right. But when you commit something to the superproject,
> why shouldn't the current submodule SHA1 be stored? Floating is about
> _ignoring_ the recorded SHA1 in _some_ cases, not about disabling the
> recording. So you can bisect to the bad superproject commit. If you suspect a
> bad submodule commit causing the problem then you could still bisect the
> submodule commits between the recorded SHA1s.

To me this question is one of the more problematic aspects of floating submodules: When to commit submodule SHA1s.

Andreas suggests always committing them whenever a submodule's tip is moved.
 I don't think this is practical because commits end up with extra changes
that likely have nothing to do with the commit's topic.  This makes it
difficult to merge (or even cherry-pick) a commit elsewhere without also
picking up an unwanted submodule update.

Jens suggests never committing submodule SHA1s. This makes it difficult to restore the submodules to the state they were in when a super-repo commit was made. To me this is unacceptable -- if commits don't encompass the entire state of the repo (including its submodules) then they're pretty much useless. Well, maybe commits themselves don't need to do that, but I sure need some way to restore the entire state of the repo.

I'm not sure there's a good or easy answer here. I suspect that it should always be up to the user whether or not submodule changes are included in a commit. The way git currently works, that means that a floating checkout would always have a modified status when in fact it isn't really dirty but merely smudged.

Wish I could propose a solution, but all I have are questions!
		M.
Previous: Andreas T.Auer
Message 18 of 18 in “Auto update submodules after merge and reset”
  1. Max KrasnyanskyNov 30, 2011
  2. Jens LehmannNov 30, 2011
  3. Max KrasnyanskyDec 6, 2011
  4. Jens LehmannDec 6, 2011
  5. Andreas T.AuerDec 7, 2011
  6. Jens LehmannDec 7, 2011
  7. andreas.t.auer_gtml_37453@ursus.ath.cxDec 8, 2011
  8. Phil HordDec 9, 2011
  9. Andreas T.AuerDec 10, 2011
  10. Phil HordDec 11, 2011
  11. Andreas T.AuerDec 11, 2011
  12. Jens LehmannDec 12, 2011
  13. Phil HordDec 12, 2011
  14. Jens LehmannDec 13, 2011
  15. Andreas T.AuerDec 13, 2011
  16. Jens LehmannDec 13, 2011
  17. Andreas T.AuerDec 13, 2011
  18. Marc BranchaudDec 14, 2011

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.