Re: Running git-archive recursively over submodules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]