From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: project.el: git submodules? Date: Thu, 14 May 2020 16:01:01 -0400 Message-ID: References: <875zd1ni5i.fsf@md5i.com> <55769244-c84c-dff0-4427-9ff688f81af5@yandex.ru> <87v9l0nar5.fsf@md5i.com> <95a8c285-125f-afda-b1bc-d1c0452e5c31@yandex.ru> <1bc2052e-b26b-1f3d-f78c-a22112861f27@yandex.ru> <7b247aac-28bd-94c1-2546-524edde9b781@yandex.ru> <42510ba9-1235-7180-af36-2d9de24835b4@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="97093"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Michael Welsh Duggan , Gary Oberbrunner , emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 14 22:02:29 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jZK3p-000P9t-0O for ged-emacs-devel@m.gmane-mx.org; Thu, 14 May 2020 22:02:29 +0200 Original-Received: from localhost ([::1]:47648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZK3o-0007pP-2I for ged-emacs-devel@m.gmane-mx.org; Thu, 14 May 2020 16:02:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZK2X-00074D-U9 for emacs-devel@gnu.org; Thu, 14 May 2020 16:01:09 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:59892) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZK2T-00008k-Gc for emacs-devel@gnu.org; Thu, 14 May 2020 16:01:09 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 87FD710031E; Thu, 14 May 2020 16:01:04 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C276F10024D; Thu, 14 May 2020 16:01:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1589486462; bh=jf5WnijpXFAkBxLdPIS57ERl+ZXBnTTyiRNSSzaAS3k=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=XuiGkag4YRNKewLgNgMfVWc8QBhnPg4E8lf7/iEX/MNCOTefLW0ZrhWMR/VSArkfY h8m4MyaFFDh9oHbk/2OS51yx6uJjGwzzP9fcYnlHPJfzC+1rF5AsP7q3uZzhwgsu0F bLAi9eNHQD8K/MZ/ew0sbb5cixTaQnzkMCiPXLmD+ahuJZt3qf9LG0cnH0+DIJQKvI 7GgnpPJUFwWdsY233ELgmA6g6IsMvTuzPZ44Y7zEeKSCCaGVnSAYrxJd44c2Gp5VN9 ohoaOdm+3tdcxb2hIrf1wp/VKHxqG9cG6QIlytSTR103N5DimSfkFxw/UpsdNE6e+X WpAnuTVjNI6oA== Original-Received: from alfajor (unknown [216.154.3.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 77B5B1203B5; Thu, 14 May 2020 16:01:02 -0400 (EDT) In-Reply-To: (Dmitry Gutov's message of "Thu, 14 May 2020 22:29:23 +0300") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 13:41:42 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:250287 Archived-At: > 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