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

[PATCH v1 0/1] Teach status to show ignored directories

From
JMJameson Miller <jameson.miller81@gmail.com>
Date
Aug 10, 2017, 18:49 UTC
Message-ID
<20170810184936.239542-1-jamill@microsoft.com>

Our application (Visual Studio) needs to run git status with options to report untracked and ignored files. It needs all untracked files reported individually, but would rather not have all individual ignored files under explicitly ignored directories reported. Directories that match an ignore pattern should be reported, instead of all contained files.

It is not possible to get this output with the current arguments available to git status. You can get ignored files (--ignored), all untracked files (--untracked-files=all), but if you specify both options then you will also get all individual ignored files.

This change is to add the option to have git status report all untracked files while also reporting directories that match an ignore pattern. The logic in dir.c was also modified to not iterate over all files in an ignored directory. This change resulted in a performance improvement in work directories with a large number of files contained in ignored directories. For example, this setup is present when bin and obj directories are contained in the repository work dir.

Jameson Miller (1):
  dir: teach status to show ignored directories
 Documentation/git-status.txt                      |   5 +
 Documentation/technical/api-directory-listing.txt |   6 +
 builtin/commit.c                                  |   4 +
 dir.c                                             |  48 +++++-
 dir.h                                             |   3 +-
 t/t7519-status-show-ignored-directory.sh          | 189 ++++++++++++++++++++++
 wt-status.c                                       |   4 +
 wt-status.h                                       |   1 +
 8 files changed, 253 insertions(+), 7 deletions(-)
 create mode 100755 t/t7519-status-show-ignored-directory.sh
-- 
2.11.0
Next: Jameson Miller
Message 1 of 11 in “Teach status to show ignored directories”
  1. 0/1 Teach status to show ignored directoriesJameson Miller, Aug 10, 2017
  2. 1/1 dir: teach status to show ignored directoriesJameson Miller, Aug 10, 2017
  3. Stefan BellerAug 10, 2017
  4. Jameson MillerAug 11, 2017
  5. Stefan BellerAug 14, 2017
  6. Brandon WilliamsAug 11, 2017
  7. Jameson MillerAug 11, 2017
  8. Improve performance of git status --ignoredJameson Miller, Sep 18, 2017
  9. Improve performance of git status --ignoredJameson Miller, Sep 18, 2017
  10. Junio C HamanoSep 19, 2017
  11. Brandon WilliamsSep 19, 2017

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.