5.1.2 Status File List Sections

These functions honor the buffer’s file filter, which can be set using D - -.

Function: magit-insert-untracked-files

This function may insert a list of untracked files. Whether it actually does so, depends on the option described next.

User Option: magit-status-show-untracked-files

This option controls whether the above function inserts a list of untracked files in the status buffer.

  • If nil, do not list any untracked files.
  • If t, list untracked files, but if a directory does not contain any untracked files, then only list that directory, not the contained untracked files.
  • If all, then list each individual untracked files. This is can be very slow and is discouraged.

The corresponding values for the Git variable are "no", "normal" and "all".

To disable listing untracked files in a specific repository only, add the following to .dir-locals.el:

((magit-status-mode
 (magit-status-show-untracked-files . "no")))

Alternatively (and mostly for historic reasons), it is possible to use git config to set the repository-local value:

git config set --local status.showUntrackedFiles no

This does not override the (if any) local value of this Lisp variable, but it does override its global value.

See the last section in the git-status(1) manpage, to speed up the part of the work Git is responsible for. Turning that list into sections is also not free, so Magit only lists magit-status-file-list-limit files.

User Option: magit-status-file-list-limit

This option controls many files are listed at most in each section that lists files in the status buffer. For performance reasons, it is recommended that you do not increase this limit.

While the above function is a member of magit-status-section-hook by default, the following functions have to be explicitly added by the user. Because that negatively affects performance, it is recommended that you don’t do that.

Function: magit-insert-tracked-files

Insert a list of tracked files.

Function: magit-insert-ignored-files

Insert a list of ignored files.

Function: magit-insert-skip-worktree-files

Insert a list of skip-worktree files.

Function: magit-insert-assumed-unchanged-files

Insert a list of files that are assumed to be unchanged.