git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Herland <johan@herland.net>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Chris Frey <cdfrey@foursquare.net>
Subject: Re: git-status for submodules
Date: Fri, 21 Nov 2008 16:27:10 +0100	[thread overview]
Message-ID: <200811211627.10637.johan@herland.net> (raw)
In-Reply-To: <7vabbtqga8.fsf@gitster.siamese.dyndns.org>

On Friday 21 November 2008, Junio C Hamano wrote:
> 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:
> > 	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.

Chris' workflow is farily easily supported by running git-status within 
each submodule, like this:

git submodule foreach "git status; true"

If the above is too cumbersome to type, one can easily wrap an alias 
around it:

git config alias.substatus 'submodule foreach "git status; true"'
git substatus


Have fun! :)

...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

  reply	other threads:[~2008-11-21 15:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-20  3:36 git-status for submodules Chris Frey
2008-11-21 14:56 ` Junio C Hamano
2008-11-21 15:27   ` Johan Herland [this message]
2008-11-21 21:56     ` Chris Frey
2008-11-21 22:42   ` Chris Frey
2008-11-22  0:55     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200811211627.10637.johan@herland.net \
    --to=johan@herland.net \
    --cc=cdfrey@foursquare.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).