emacs-devel
[Top][All Lists]
Advanced

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

Re: project.el: git submodules?


From: Stefan Monnier
Subject: Re: project.el: git submodules?
Date: Thu, 14 May 2020 16:01:01 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> Here's the patch I made according to your description:
>
> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
> index ac56537b97..bf737e821a 100644
> --- a/lisp/progmodes/project.el
> +++ b/lisp/progmodes/project.el
> @@ -266,11 +266,18 @@ project-try-vc
>    (let* ((backend (ignore-errors (vc-responsible-backend dir)))
>           (root
>            (pcase backend
> -            ('Git
> +            (`(or ,'Git ,'Hg)
>               ;; Don't stop at submodule boundary.
> -             (or (vc-file-getprop dir 'project-git-root)
> -                 (vc-file-setprop dir 'project-git-root
> -                                  (vc-find-root dir ".git/"))))
> +             (or (vc-file-getprop dir 'project-vc-root)
> +                 (let* ((default-directory dir)
> +                        (root (vc-root-dir))
> +                        (parent (file-name-directory
> +                                 (directory-file-name root))))
> +                   (vc-file-setprop dir 'project-vc-root
> +                                    (or
> +                                     (let ((default-directory parent))
> +                                       (vc-root-dir))
> +                                     root)))))

I'm not familiar enough with this code to understand what it does: which
part tests "is it a submodule"?  Or alternatively, which part compares
the location of the two repositories?


        Stefan




reply via email to

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