branch: elpa/magit commit 04535105addd9e926a2f459707873ad8b43b0071 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
magit-insert-untracked-files: Fix use of status.showUntrackedFiles Previously the meanings of "normal" and "all" were inverted. Now "all" means "show all untracked" files, just like for `git status'. "normal" means "show untracked files and directories", but while in the case of `git status' that means that individual non-top-level files are never shown, in our case directory sections can be expanded on demand to show them when needed. --- docs/magit.org | 5 +---- docs/magit.texi | 5 +---- lisp/magit-status.el | 9 +++------ 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/docs/magit.org b/docs/magit.org index 17e95df197f..ec110420579 100644 --- a/docs/magit.org +++ b/docs/magit.org @@ -2221,10 +2221,7 @@ By default the following functions are also members of that hook: Maybe insert a list or tree of untracked files. - Do so depending on the value of ~status.showUntrackedFiles~. Note - that even if the value is ~all~, Magit still initially only shows - directories. But the directory sections can then be expanded using - ~TAB~. + Do so depending on the value of ~status.showUntrackedFiles~. If the first element of ~magit-buffer-diff-files~ is a directory, then limit the list to files below that. The value of that variable can diff --git a/docs/magit.texi b/docs/magit.texi index 65e1f5d9e1d..af960f7dabe 100644 --- a/docs/magit.texi +++ b/docs/magit.texi @@ -2602,10 +2602,7 @@ While bisecting, insert section logging bisect progress. @defun magit-insert-untracked-files Maybe insert a list or tree of untracked files. -Do so depending on the value of @code{status.showUntrackedFiles}. Note -that even if the value is @code{all}, Magit still initially only shows -directories. But the directory sections can then be expanded using -@code{TAB}. +Do so depending on the value of @code{status.showUntrackedFiles}. If the first element of @code{magit-buffer-diff-files} is a directory, then limit the list to files below that. The value of that variable can diff --git a/lisp/magit-status.el b/lisp/magit-status.el index 9da5782093f..f4a8c5940a7 100644 --- a/lisp/magit-status.el +++ b/lisp/magit-status.el @@ -708,10 +708,7 @@ remote in alphabetic order." (defun magit-insert-untracked-files () "Maybe insert a list or tree of untracked files. -Do so depending on the value of `status.showUntrackedFiles'. Note -that even if the value is `all', Magit still initially only shows -directories. But the directory sections can then be expanded using -\"TAB\". +Do so depending on the value of `status.showUntrackedFiles'. If the first element of `magit-buffer-diff-files' is a directory, then limit the list to files below that. The value of that variable can be @@ -722,8 +719,8 @@ set using \"D -- DIRECTORY RET g\"." (base (car magit-buffer-diff-files)) (base (and base (file-directory-p base) base))) (magit-insert-files 'untracked - (lambda () (magit-untracked-files nil base (not all))) - (not all)))))) + (lambda () (magit-untracked-files nil base all)) + all))))) (defun magit-insert-tracked-files () "Insert a tree of tracked files.