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.