From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Michael Welsh Duggan Newsgroups: gmane.emacs.devel Subject: Re: project.el: git submodules? Date: Tue, 12 May 2020 16:51:18 -0400 Message-ID: <87r1vonagp.fsf@md5i.com> References: <875zd1ni5i.fsf@md5i.com> <55769244-c84c-dff0-4427-9ff688f81af5@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="35460"; 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 Tue May 12 22:53:00 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 1jYbtb-00093E-QP for ged-emacs-devel@m.gmane-mx.org; Tue, 12 May 2020 22:52:59 +0200 Original-Received: from localhost ([::1]:51166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYbta-0006Uo-Q4 for ged-emacs-devel@m.gmane-mx.org; Tue, 12 May 2020 16:52:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYbs8-0005yq-CO for emacs-devel@gnu.org; Tue, 12 May 2020 16:51:29 -0400 Original-Received: from md5i.com ([75.151.244.229]:36652) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYbs6-0005BF-1f for emacs-devel@gnu.org; Tue, 12 May 2020 16:51:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=md5i.com; s=dkim; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=vIty7FVrJSiLFC/k7z8eYtQFZYVf5F2EKe0z+wzumn8=; b=HTQaPPpl7IzgKitcGTPV7Smwzs 3TB2xCI+oUpDhw0WKnWEgxcZyqq2Se1FWAjygGVjX5dWKNb4EM4wbxgX6a/G6DNO1YbSXpixpWb4P EFBCRNxfTN+Dp74o/5hzGNu9G; Original-Received: from md5i by md5i.com with local (Exim 4.93) (envelope-from ) id 1jYbry-000OQI-PB; Tue, 12 May 2020 16:51:18 -0400 In-Reply-To: <55769244-c84c-dff0-4427-9ff688f81af5@yandex.ru> (Dmitry Gutov's message of "Tue, 12 May 2020 21:27:09 +0300") Received-SPF: pass client-ip=75.151.244.229; envelope-from=mwd@md5i.com; helo=md5i.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/12 16:45:09 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_PASS=-0.001, 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:250041 Archived-At: Dmitry Gutov writes: > On 12.05.2020 21:05, Michael Welsh Duggan wrote: >> It's not only submodules, though. Git worktrees also just use a .git >> file. > > I'm not an expert, and you can suggest better logic. git rev-parse --show-superproject-working-tree This will return an empty string if CWD is not a submodule. https://stackoverflow.com/questions/52047148/how-to-check-if-the-current-repository-is-the-top-level-git-repo/52913255 -- Michael Welsh Duggan (md5i@md5i.com)