emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master dba8f37: * lisp/progmodes/project.el (project-try-vc): Fix regexp


From: Stefan Monnier
Subject: master dba8f37: * lisp/progmodes/project.el (project-try-vc): Fix regexp typo.
Date: Fri, 15 May 2020 17:30:53 -0400 (EDT)

branch: master
commit dba8f3783b209fef5be2589528ed43a99a8bab6a
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * lisp/progmodes/project.el (project-try-vc): Fix regexp typo.
---
 lisp/progmodes/project.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 0ce2786..2092d69 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -273,6 +273,13 @@ backend implementation of `project-external-roots'.")
           (pcase backend
             ('Git
              ;; Don't stop at submodule boundary.
+             ;; Note: It's not necessarily clear-cut what should be
+             ;; considered a "submodule" in the sense that some users
+             ;; may setup things equivalent to "git-submodule"s using
+             ;; "git worktree" instead (for example).
+             ;; FIXME: Also it may be the case that some users would consider
+             ;; a submodule as its own project.  So there's a good chance
+             ;; we will need to let the user tell us what is their intention.
              (or (vc-file-getprop dir 'project-git-root)
                  (let* ((root (vc-call-backend backend 'root dir))
                         (gitfile (expand-file-name ".git" root)))
@@ -284,7 +291,9 @@ backend implementation of `project-external-roots'.")
                      ((with-temp-buffer
                         (insert-file-contents gitfile)
                         (goto-char (point-min))
-                        (looking-at "gitdir: [./]+/\.git/modules/"))
+                        ;; Kind of a hack to distinguish a submodule from
+                        ;; other cases of .git files pointing elsewhere.
+                        (looking-at "gitdir: [./]+/\\.git/modules/"))
                       (let* ((parent (file-name-directory
                                       (directory-file-name root))))
                         (vc-call-backend backend 'root parent)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]