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

[BUG?] ls-files -o now traverses nested repo when given multiple pathspecs

From
Kyle Meyer <kyle@kyleam.com>
Date
Dec 3, 2019, 22:08 UTC
Message-ID
<87fti15agv.fsf@kyleam.com>

89a1f4aaf7 (dir: if our pathspec might match files under a dir, recurse into it, 2019-09-17) introduced a change in behavior in terms of traversing untracked nested repositories. Say we have a repository that contains a single untracked repository with untracked content:

    $ git init && git init a && touch a/x

Calling ls-files with the nested repository as the sole pathspec does not recurse into that repository:

    $ git ls-files --other a
    a/

However, as of 89a1f4aaf7, adding an additional pathspec results in the nested repository being traversed:

    $ git ls-files --other a foo
    a/
    a/x

Reading 89a1f4aaf7 and skimming the patch series and related thread [*], I haven't found anything that makes me think this change in behavior was intentional.

[*]: https://lore.kernel.org/git/20190905154735.29784-1-newren@gmail.com/
Next: Elijah Newren
Message 1 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.