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

ls-files -o -i --directory omits files/directories

From
JHJakub Horodecki <jakub.horodecki@gmail.com>
Date
Apr 20, 2020, 08:03 UTC
Message-ID
<CAGdVfV2JhBp1_3iBWg_3gm5zDPwGizQxiK5QXJSRbDkN4Si4Lw@mail.gmail.com>
Hello

I found a case for git ls-files I suspect might be a bug. For the following example repository structure:

.
|--   InnerDir
|     |--   excluded.txt
|--   file1.txt
|--   .gitignore

and the .gitignore content: InnerDir/*

the command
git ls-files -oi --exclude-standard --directory

returns no results, that is neither "InnerDir/" directory nor "InnerDir/excluded.txt" file. I would expect one of the entries since at the moment information about the file is missing completely in the listing. Both executing the command without --directory flag and adding "InnerDir" to .gitignore produce some output from the command.

So the command returns no results for --others excluded files if --directory flag is specified and all files in a directory are ignored (but directory itself is not). Is this actually a bug or I misunderstood something?

I tested it on latest release of Git for Windows (2.26.1.windows.1, x64).

Best Regards Jakub Horodecki

Message 1 of 1 in “ls-files -o -i --directory omits files/directories”
  1. Jakub HorodeckiApr 20, 2020

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.