Re: [PATCH 1/2] ls-files: adding support for submodules
From: Junio C Hamano <hidden>
Date: 2016-09-27 22:23:11
Brandon Williams [off-list ref] writes:
quoted
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.