Re: [PATCH 2/7] submodule foreach: correct path computation in recursive submodules
On Tue, Mar 29, 2016 at 12:21 PM, Stefan Beller <sbeller@google.com> wrote:
Show 31 quoted lines
> On Tue, Mar 29, 2016 at 12:00 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Junio C Hamano <gitster@pobox.com> writes:
>>
>>> Stefan Beller <sbeller@google.com> writes:
>>>
>>>> The test which is fixed by this patch would report
>>>> Entering 'nested1/nested2/../nested3'
>>>> instead of the expected
>>>> Entering '../nested1/nested2/nested3'
>>>>
>>>> because the prefix is put unconditionally in front and after that a
>>>> computed display path with is affected by `wt_prefix`. This is wrong as
>>>> any relative path computation would need to be at the front. By emptying
>>>> the `wt_prefix` in recursive submodules and adding the information of any
>>>> relative path into the `prefix` this is fixed.
>>>>
>>>> Signed-off-by: Stefan Beller <sbeller@google.com>
>>>> ---
>>>
>>> Nicely explained and executed.
>>
>> Interestingly, this breakage, as 1/7 shows, only affects the
>> "Entering $there" message--I somehow expected from reading the
>> description above that the command given to "foreach" is run
>> in a wrong submodule directory, but there is no such bug that
>> is fixed by this change, as far as "foreach" is concerned.
>
> foreach is a special beast as it is the only submodule command that
> ignores the current directory, i.e.
> cd repo/plugins && git submodule foreach ...
> also affects submodules in repo/other-submodules.
I missspoke.
It actually respects the sub directory, but no further path spec. :(