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

Git Submodule Problem - Bug?

From
MKManuel Koller <koller.manuel@gmail.com>
Date
Nov 28, 2011, 17:13 UTC
Message-ID
<38AE3033-6902-48AA-819B-DB4083F1F8EF@gmail.com>
Hi
I've encountered strange behavior of git submodule and I cannot think about a way to avoid the problem. I've added a small script that reproduces the problem in the current version of git (1.7.7.3, git-osx-installer).
The problem arises when I pull a commit that switches a submodule with another one and then run git submodule update. Say I have a repo "super" that has one submodule "sub1" in the folder "sub" and a clone "super2". Now I remove the submodule in "super2" and add another one ("sub2") again named "sub", commit this and push it. Now after pulling the commit to "super", I need to run git submodule sync and then git submodule update. 
I expect to end up with the submodule "sub2" in sub. But the log clearly shows that the commits from "sub1" are still there (the master branch belongs to "sub1" while origin/master comes from "sub2").  I get the following output:
Show 11 quoted lines
> ...
> commit 77d8d11fed3b07e1d4e47b3df9fc44c278694a39
> Author: Manuel Koller <koller@stat.math.ethz.ch>
> Date:   Mon Nov 28 17:46:45 2011 +0100
> 
>     initial commit sub1
> commit 346fe6bd9e7957f10c5e833bb1155153379da41c
> Author: Manuel Koller <koller@stat.math.ethz.ch>
> Date:   Mon Nov 28 17:46:45 2011 +0100
> 
>     initial commit sub2
I think it should be twice the same, and "sub2". I checked also with Charon, on his machine, the two log messages reported are "sub1" which completely baffles me.
Best regards,
Manuel
Next: Thomas Rast
Message 1 of 11 in “Git Submodule Problem - Bug?”
  1. Manuel KollerNov 28, 2011
  2. Thomas RastNov 29, 2011
  3. Fredrik GustafssonNov 29, 2011
  4. Thomas RastNov 29, 2011
  5. Fredrik GustafssonNov 29, 2011
  6. Jens LehmannNov 29, 2011
  7. Manuel KollerNov 29, 2011
  8. Junio C HamanoNov 29, 2011
  9. Heiko VoigtNov 29, 2011
  10. Manuel KollerDec 7, 2011
  11. Jens LehmannDec 7, 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.