Re: [PATCH] submodule foreach: correct $sm_path in nested submodules from a dir

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

 




On 03/06/17 15:07, Ramsay Jones wrote:
[snip]

>> diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
>> index 74bc6200d5..52e3ef1325 100644
>> --- a/Documentation/git-submodule.txt
>> +++ b/Documentation/git-submodule.txt
>> @@ -218,20 +218,24 @@ information too.
>>  
>>  foreach [--recursive] <command>::
>>  	Evaluates an arbitrary shell command in each checked out submodule.
>> -	The command has access to the variables $name, $path, $sha1 and
>> -	$toplevel:
>> -	$name is the name of the relevant submodule section in .gitmodules,
>> -	$path is the name of the submodule directory relative to the
>> -	superproject, $sha1 is the commit as recorded in the superproject,
>> -	and $toplevel is the absolute path to the top-level of the superproject.
>> -	Any submodules defined in the superproject but not checked out are
>> -	ignored by this command. Unless given `--quiet`, foreach prints the name
>> -	of each submodule before evaluating the command.
>> -	If `--recursive` is given, submodules are traversed recursively (i.e.
>> -	the given shell command is evaluated in nested submodules as well).
>> -	A non-zero return from the command in any submodule causes
>> -	the processing to terminate. This can be overridden by adding '|| :'
>> -	to the end of the command.
>> +	The command has access to the following variables:
>> ++
>> +* `$name` is the name of the relevant submodule section in .gitmodules,
>> +* `$sha1` is the commit as recorded in the superproject.
>> +* `$sm_path` is the path recorded in the superproject.
> 
> Just to be sure, the 'path recorded in the superproject' means the
> same thing as the 'name of the submodule directory relative to the
> superproject'. Yes?
> 
>> +* `$toplevel` is the absolute path to its superproject, such that
>> +  `$toplevel/$sm_path` is the absolute path of the submodule.
>> +* `$dpath` contains the relative path from the current working directory
>> +   to the submodules root directory.

BTW, I have not given any thought to what happens to these
variables/paths if you run '--recursive'. I assume the new
'recursed' submodule takes on the role of the 'superproject'
in the definitions above. Hmm, but what does $dpath show?
(having 'recursed', is the cwd now at the top level of the
'new' superproject?)

Hmm, you have changed several command to recurse into
submodule(s) (I haven't followed that effort closely), so
I suppose it should have some measure of consistency with
those commands. (whatever that means ;-)

ATB,
Ramsay Jones





[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]