Re: [BUG?] ls-files -o now traverses nested repo when given multiple pathspecs
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 4, 2019, 19:42 UTC
- Message-ID
- <xmqqblsn514l.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <CABPp-BFG3FkTkC=L1v97LUksndkOmCN8ZhNJh5eoNdquE7v9DA@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
> C) ls-files -o should NOT traverse into untracked submodules, but > should at least report their directory name.
I think this probably is the most sensible.
The top-level directory of a working tree of a repository other than the current one may exist in the working tree. It is very tempting to declare that, unless we know it is a submodule that has the current repository as its superproject, we should just treat it as a normal subdirectory without *any* files tracked by the current repository, which would mean that we pretend that the ".git/" in that subdirectory is not any special---but that would obviously make things quite messy (e.g. our "ls-files -o" would descend into the other project's working tree and even in its .git/ directory), so we need to special case a directory that has ".git/" in it, whether it is a submodule for our current repository or not.
Thanks for working on this. I agree that dir.c traversal has become messier and messier, especially with its interaction with submodules.