mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-22 07:09:54 +00:00
project--vc-list-files: Use '--sparse' with 'git ls-files'
When dealing with exceptionally large Git repositories, the performance of `project-find-file` can suffer dramatically as the list of files is collected for completion. This adds insult to injury when you consider cases where the developer has configured the repository to use a sparse checkout where the vast majority of these files are not even present on disk and are not valid candidates for completion. * lisp/progmodes/project.el (project--vc-list-files): Pass 'sparse' to 'git ls-files' when Git is recent enough. Filter out file names that end with '/' (bug#73320).
This commit is contained in:
parent
c934450d14
commit
8d9a4647fb
@ -663,7 +663,7 @@ See `project-vc-extra-root-markers' for the marker value format.")
|
||||
(pcase backend
|
||||
(`Git
|
||||
(let* ((default-directory (expand-file-name (file-name-as-directory dir)))
|
||||
(args '("-z"))
|
||||
(args '("-z" "-c" "--exclude-standard"))
|
||||
(vc-git-use-literal-pathspecs nil)
|
||||
(include-untracked (project--value-in-dir
|
||||
'project-vc-include-untracked
|
||||
@ -671,7 +671,8 @@ See `project-vc-extra-root-markers' for the marker value format.")
|
||||
(submodules (project--git-submodules))
|
||||
files)
|
||||
(setq args (append args
|
||||
'("-c" "--exclude-standard")
|
||||
(and (version<= "2.35" (vc-git--program-version))
|
||||
'("--sparse"))
|
||||
(and include-untracked '("-o"))))
|
||||
(when extra-ignores
|
||||
(setq args (append args
|
||||
@ -703,7 +704,10 @@ See `project-vc-extra-root-markers' for the marker value format.")
|
||||
(delq nil
|
||||
(mapcar
|
||||
(lambda (file)
|
||||
(unless (member file submodules)
|
||||
(unless (or (member file submodules)
|
||||
;; Should occur for sparse directories
|
||||
;; only, when sparse index is enabled.
|
||||
(directory-name-p file))
|
||||
(if project-files-relative-names
|
||||
file
|
||||
(concat default-directory file))))
|
||||
|
Loading…
Reference in New Issue
Block a user