git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Elijah NewrenNext: Kyle Meyer
Message 3 of 8 in “[BUG?] ls-files -o now traverses nested repo when given multiple pathspecs”
  1. Kyle MeyerDec 3, 2019
  2. Elijah NewrenDec 4, 2019
  3. Junio C HamanoDec 4, 2019
  4. Kyle MeyerDec 4, 2019
  5. Kyle MeyerDec 8, 2019
  6. Elijah NewrenDec 8, 2019
  7. Elijah NewrenDec 8, 2019
  8. Kyle MeyerDec 8, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.