[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 2cc48d3: Fix setting project-vc-merge-submodules via .dir-locals.
From: |
Dmitry Gutov |
Subject: |
master 2cc48d3: Fix setting project-vc-merge-submodules via .dir-locals.el |
Date: |
Wed, 17 Jun 2020 18:53:45 -0400 (EDT) |
branch: master
commit 2cc48d3d10a7a0e3ced644c75972e2af2364e68b
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
Fix setting project-vc-merge-submodules via .dir-locals.el
* lisp/progmodes/project.el
(project--vc-merge-submodules-p): New function.
(project-try-vc, project--vc-list-files): Use it.
---
lisp/progmodes/project.el | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 0921922..1c1891f 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -306,7 +306,7 @@ backend implementation of `project-external-roots'.")
(if (and
;; FIXME: Invalidate the cache when the value
;; of this variable changes.
- project-vc-merge-submodules
+ (project--vc-merge-submodules-p root)
(project--submodule-p root))
(let* ((parent (file-name-directory
(directory-file-name root))))
@@ -396,19 +396,20 @@ backend implementation of `project-external-roots'.")
(split-string
(apply #'vc-git--run-command-string nil "ls-files" args)
"\0" t)))
- ;; Unfortunately, 'ls-files --recurse-submodules' conflicts with '-o'.
- (let* ((submodules (project--git-submodules))
- (sub-files
- (mapcar
- (lambda (module)
- (when (file-directory-p module)
- (project--vc-list-files
- (concat default-directory module)
- backend
- extra-ignores)))
- submodules)))
- (setq files
- (apply #'nconc files sub-files)))
+ (when (project--vc-merge-submodules-p default-directory)
+ ;; Unfortunately, 'ls-files --recurse-submodules' conflicts with '-o'.
+ (let* ((submodules (project--git-submodules))
+ (sub-files
+ (mapcar
+ (lambda (module)
+ (when (file-directory-p module)
+ (project--vc-list-files
+ (concat default-directory module)
+ backend
+ extra-ignores)))
+ submodules)))
+ (setq files
+ (apply #'nconc files sub-files))))
;; 'git ls-files' returns duplicate entries for merge conflicts.
;; XXX: Better solutions welcome, but this seems cheap enough.
(delete-consecutive-dups files)))
@@ -429,6 +430,11 @@ backend implementation of `project-external-roots'.")
(lambda (s) (concat default-directory s))
(split-string (buffer-string) "\0" t)))))))
+(defun project--vc-merge-submodules-p (dir)
+ (project--value-in-dir
+ 'project-vc-merge-submodules
+ dir))
+
(defun project--git-submodules ()
;; 'git submodule foreach' is much slower.
(condition-case nil
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 2cc48d3: Fix setting project-vc-merge-submodules via .dir-locals.el,
Dmitry Gutov <=