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

Re: git-status for submodules

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 21, 2008, 14:56 UTC
Message-ID
<7vabbtqga8.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20081120033615.GA21128@foursquare.net>
Chris Frey <cdfrey@foursquare.net> writes:
> I'm using git 1.6.0.4 and trying to make submodules work for me.  The
> init/add/update steps are a bit tedious, but workable.  The problem I have
> is when I make a change in a submodule, then git-status does not show
> the change.

My understanding is that this is exactly by design. The supermodule tracks which commit in the subproject is bound to the tree location.

A mere act of changing something in the subproject directory is just a single, incomplete step to create a new commit in the subproject and will not be seen by the superproject's status. Instead of this workflow:

Show 7 quoted lines
> 	cd super
> 	vi newsuper
> 	vi existing_file
> 	cd sub
> 	vi newsub
> 	cd ..
> 	git status
the submodule support is geared toward supporting this layout:
	- "super" has a subproject X at "sub"
        - When you do a real work on the subproject X, you do so as if
          there is no supermodule.  IOW, subproject X has to be able to
          stand on its own.

One extreme case is you have a(nother) clone of subproject X that is independent from "super", do the real work there and create new commit, and update the subproject X inside "super". In such a workflow, "super" will never see an intermediate state between commits in the subproject directory.

	
Previous: Chris FreyNext: Johan Herland
Message 2 of 6 in “git-status for submodules”
  1. Chris FreyNov 20, 2008
  2. Junio C HamanoNov 21, 2008
  3. Johan HerlandNov 21, 2008
  4. Chris FreyNov 21, 2008
  5. Chris FreyNov 21, 2008
  6. Junio C HamanoNov 22, 2008

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.