From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: project.el: git submodules? Date: Fri, 15 May 2020 00:17:55 +0300 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> <21e149fc-dba5-47f0-ea7f-60a16ea32819@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="38098"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Cc: Michael Welsh Duggan , Gary Oberbrunner , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 14 23:18:39 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 1jZLFX-0009nh-4c for ged-emacs-devel@m.gmane-mx.org; Thu, 14 May 2020 23:18:39 +0200 Original-Received: from localhost ([::1]:48426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZLFW-00062T-5O for ged-emacs-devel@m.gmane-mx.org; Thu, 14 May 2020 17:18:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZLEu-0005bI-EK for emacs-devel@gnu.org; Thu, 14 May 2020 17:18:00 -0400 Original-Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:53151) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jZLEt-0001yT-HG for emacs-devel@gnu.org; Thu, 14 May 2020 17:18:00 -0400 Original-Received: by mail-wm1-x341.google.com with SMTP id m24so22752232wml.2 for ; Thu, 14 May 2020 14:17:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Qib4ek9Rnxl06SxFXOqvbN13wksTCr0gkZTv5KzoU+M=; b=BEAXWsg6/SA0OjAeyIb67fLRar2AgpnRzsZe3/jiLVAi/vF4iM64pULANz3RkvKRrv iYTu7lh6D3n75Moa3hFIJFxIY/ExZNhMFEWhJknUMZmh4OSGvJmPuhojsgmMKqDNl6jS mTbRzkdNFNyiKzRO6YLP3Pmn9zSPWUN4icApXxg1DcsxnxfjyFWy7+zvSTQWTzWTT/Eq AoCE/HJvk523V1tA+EhC+sXfqgD5JQf5yPwTzOJ/RzsngQJKQ5Bhr/dFBxNaDXW8vAiH XVhCKSCfAid/3Rskq8KG9QDFRv0LeMoombnAlgGKWk+qQF9vqPwF5V6YQSlCKlSPKO8B 7IrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:cc:references:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Qib4ek9Rnxl06SxFXOqvbN13wksTCr0gkZTv5KzoU+M=; b=I/O9HiSsrS5rkDA36ufqhlE7DKsBXRIV4SuBRg/SLLjm2rguPoLmoBejvXapkqwg+r xM9hNF7WU6FJSSzrnx39rZ2oRvoSJRCNlUXBBGQ4HERMuBA3hQxtKroH1RM4cXHWxQbj VhnVX9o4zAbL1J64FDf5OujPFQRtYOsdx5blZnhCGPuKMGVtLjoyk2lHQ8Bt/I3OPgCp 1ddDZ2EnM57SYf2DyTL2hFcWSsYFzYpx0fncgZ46wE26sWql9NcaaZbJp9LGXdtf37qb K57WTTd4czhMXGCntO7GRvAx6uyim3bWAu+idLKjOgxzcf9DBCqyEWzJAF6zKzE7y9Zw jXWQ== X-Gm-Message-State: AOAM5312vnGlrJIpytUfb2aH3Gf91KtzQVZtsoeKFU49Kb+VnRhjNl/U CLtePzbyP/kpmnIzBOMocBajy5Sd X-Google-Smtp-Source: ABdhPJwjOknitRBOuQPwLdiXDtleSDuLgm/hdvogVQGDEzEW+RlgtdZA4+hZ8HkDTmxA7BQJX8CHTw== X-Received: by 2002:a05:600c:2255:: with SMTP id a21mr292266wmm.67.1589491077230; Thu, 14 May 2020 14:17:57 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id a184sm477273wmh.24.2020.05.14.14.17.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 May 2020 14:17:56 -0700 (PDT) In-Reply-To: <21e149fc-dba5-47f0-ea7f-60a16ea32819@yandex.ru> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=raaahh@gmail.com; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-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:250295 Archived-At: On 14.05.2020 23:13, Dmitry Gutov wrote: > On 14.05.2020 23:01, Stefan Monnier wrote: >> +                                    (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"? > > The removed part. > >> Or alternatively, which part compares >> the location of the two repositories? > > The part quoted above. If the parent directory of the root of the > current Git worktree belongs to a VC worktree (vc-root-dir returns > non-nil), use that worktree's root. Otherwise, use the root of the > current repo. Ah. After re-reading your initial message, I think I understand it better. But to compare, we'd need to read the contents of both .git files/directories, right? That, um, sounds more complex than the current solution. And more file reads = worse performance over Tramp, so it's not just implementation difficulty. Regarding the particulars, I suppose if .git is a file, and it starts with gitdir: ../../.git/ where the number of "../" is two or more, then the current dir is probably a submodule.