Re: [PATCH 1/2] ls-files: adding support for submodules

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

 



Brandon Williams <bmwill@xxxxxxxxxx> writes:

>> If you are in a subdirectory of your superproject, say, a/,
>> 
>>     cd a && git ls-files --recurse-submodules -- "b*"
>> 
>> I would expect we would recurse into the submodule at "a/b" and find
>> "b/file-at-top-of-B".  What does the internal invocation to do so
>> would look like?  I would think "git -C b --super=b ls-files" that
>> is run from "a".

Actually, the internal invocation may have to be

	$ git --super=a/b ls-files -- "a/b*"

if the desired overall output needs to be in the "--full-name" mode.
That is, the top-level recursive one may be

    cd a && git ls-files --recurse-submodules --full-name -- "b*"

This top-level "ls-files" will have "prefix" set to "a/".  Because
it is run in the "--full-name" mode, after finding that the
submodule at "a/b" matches the given pathspec and deciding to
recurse into it, it needs to arrange that paths stored in the index
of the submodule are prefixed with "a/b/", not with "b/", when
shown.




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