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: Tue, 12 May 2020 23:53:19 +0300 Message-ID: <95a8c285-125f-afda-b1bc-d1c0452e5c31@yandex.ru> References: <875zd1ni5i.fsf@md5i.com> <55769244-c84c-dff0-4427-9ff688f81af5@yandex.ru> <87v9l0nar5.fsf@md5i.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="39361"; 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: Gary Oberbrunner , emacs-devel@gnu.org To: Michael Welsh Duggan , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 12 22:54: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 1jYbuY-000A9D-V5 for ged-emacs-devel@m.gmane-mx.org; Tue, 12 May 2020 22:53:58 +0200 Original-Received: from localhost ([::1]:53046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYbuY-0007IV-1W for ged-emacs-devel@m.gmane-mx.org; Tue, 12 May 2020 16:53:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYbu0-0006kG-UK for emacs-devel@gnu.org; Tue, 12 May 2020 16:53:24 -0400 Original-Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:34711) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYbtz-0005b1-RG for emacs-devel@gnu.org; Tue, 12 May 2020 16:53:24 -0400 Original-Received: by mail-wr1-x433.google.com with SMTP id y3so17616166wrt.1 for ; Tue, 12 May 2020 13:53:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=HHZ7jYvubzWOkrRZUcvZ3FaAyW2qcupHPEq0q0pJEJw=; b=QkAPyeMTHXwwhybLmc140fBk7K7udT5W46XMs7KpdihAW3Hv1O2M7TnLwY5RBvpX4w /0xO5ATx9uX6rxOR3Xf9cawNAB90x+41eM1r8QGuHFAdD6DLQO62F9MjPk0Tv8jYXNpd 6ujNoGPNNZagMsLOHU2dt5U9YFFOVqaZgbn4v8sJ4+sZuiZpWdtYM1vTSO3vkbW5g0La aLOeI+s26Z4zm/vD+mD1wRX4s/KUsd/LbvWuxPaxsKNhKi1cVI5L1JJG/I28fMqg7oW4 u6JGLz9piBW1xJ2rocFzSXHgI351zzZzjTtSL0/H+g4i+ymnGnezW6nXLNBWMf43Wutt HGbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=HHZ7jYvubzWOkrRZUcvZ3FaAyW2qcupHPEq0q0pJEJw=; b=Q35wWl4keOHUCKzTIKEOy1EQxDR91RK1/Kja9fRoneuTruJT2DzVNx+PavuMId6Ji+ ZOMhYlUYK92JvBHon06jYRVJrjX0qY3Zw5kebJNUQVJVelv11UxXsYQ4aG9GRyn0CRNp eFXZX318/TthVJXK2ZUh6Ovv+xIUvfxPdOdRJFE1IZCTdpOo9ipE8jgUQ6vTfpP5U8Q4 ezcQwu2iM11Fvosb+ims6WbgxLuZQubhBdX+ayVjHEKTodjdgcb/+jVFisjx5ogk6Szf Dlgu1AxJlMlGXGH91BPpo35fdov3f1EypyjXxs1g7FqVjYnI8sSYhvP1PENy5NyZYmK7 HDyw== X-Gm-Message-State: AGi0PuZdQ54tlgBpfFzbrmEngvVbGuUWo4Qsfp+ajMCkBkZCQ/V2chWb UGls8kEgAPp/dFleyQXNk66vPCHn X-Google-Smtp-Source: APiQypJbCf4pnGsqkVyIG3S93nC9jdpre2dL5LFDTGHfdr0D4Fbkk8SNFwHat950c5wUU/4MIwlDRw== X-Received: by 2002:adf:d0c5:: with SMTP id z5mr28635251wrh.410.1589316801738; Tue, 12 May 2020 13:53:21 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id w15sm7926617wmi.35.2020.05.12.13.53.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 May 2020 13:53:20 -0700 (PDT) In-Reply-To: <87v9l0nar5.fsf@md5i.com> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=raaahh@gmail.com; helo=mail-wr1-x433.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: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 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, 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:250042 Archived-At: On 12.05.2020 23:45, Michael Welsh Duggan wrote: > Stefan Monnier writes: > >>> FWIW, the examples of git worktrees on my machine all include a ".git/" >>> directory. It's just that some of its contents are symbolic links. >> Hmm... are you sure these are Git worktrees? >> Maybe they're "poor man's git-worktrees" created by the old >> `git-new-workdir` hack which has been made obsolete by the "new" `git >> worktree` feature. > Pretty sure. > > /tmp/$ git --version > /tmp$ mkdir git-test > /tmp$ cd git-test > /tmp/git-test$ mkdir repo > /tmp/git-test$ cd repo > /tmp/git-test/repo$ git init > Initialized empty Git repository in/tmp/git-test/repo/.git/ > /tmp/git-test/repo$ echo "Test file" > repo > /tmp/git-test/repo$ git add repo > /tmp/git-test/repo$ git commit -m "Initial commit." > [master (root-commit) 544fba2] Initial commit. > 1 file changed, 1 insertion(+) > create mode 100644 repo > /tmp/git-test/repo$ git worktree add ../worktree > Preparing worktree (new branch 'worktree') > HEAD is now at 544fba2 Initial commit. > /tmp/git-test/repo$ cd ../worktree/ > /tmp/git-test/worktree$ ls -la .git > -rw-r--r-- 1 md5i md5i 51 May 12 16:42 .git > /tmp/git-test/worktree$ cat .git > gitdir:/tmp/git-test/repo/.git/worktrees/worktree Perhaps you could suggest an additional test to determine whether a directory is a submodule, then? The contents of '.git' there are fairly similar: gitdir: ../../.git/modules/site-lisp/company I guess we could look inside and see whether '.git/modules/' is a substring. Detecting a project over Tramp will become a little bit slower as a result, though.