From: Michael J Gruber <git@drmicha.warpmail.net>
To: Thomas Rast <trast@student.ethz.ch>
Cc: git@vger.kernel.org
Subject: Re: Running git-archive recursively over submodules
Date: Tue, 16 Feb 2010 11:49:48 +0100 [thread overview]
Message-ID: <4B7A784C.1070405@drmicha.warpmail.net> (raw)
In-Reply-To: <201002161101.42493.trast@student.ethz.ch>
Thomas Rast venit, vidit, dixit 16.02.2010 11:01:
> On Tuesday 16 February 2010 08:38:08 Michael J Gruber wrote:
>> Thomas Rast venit, vidit, dixit 15.02.2010 21:56:
>>> while git ls-files -s | grep -q ^160000; do
>>> read_one_level
>>> done
>>
>> Am I blind, not seeing a recursion, or is there simply none? I reckon
>> you're reading the super project and one level of submodules into the
>> temporary index - which is fine for most purposes, of course. I would
>> say this is iterating over the submodules of the super project.
>
> Well, the while condition reads "while there are submodule entries in
> my index". The read_one_level function then replaces those submodules
> with their corresponding trees, which of course may again contain
> submodule entries.
>
Gotcha, and the rm --cached in foreach makes sure that submodule entries
disappear from the index once their contents have been read into it, so
that the recursion stops when there's no deeper level. Clever.
Thanks for helping my for/while blindness (I guess I was thinking "for").
Cheers,
Michael
prev parent reply other threads:[~2010-02-16 10:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-15 20:56 Running git-archive recursively over submodules Thomas Rast
2010-02-16 7:38 ` Michael J Gruber
2010-02-16 10:01 ` Thomas Rast
2010-02-16 10:49 ` Michael J Gruber [this message]
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=4B7A784C.1070405@drmicha.warpmail.net \
--to=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=trast@student.ethz.ch \
/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).