From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 50b56f9f for ; Tue, 26 Nov 2019 10:23:19 +0000 (UTC) Received: (qmail 25174 invoked by alias); 26 Nov 2019 10:23:11 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44942 Received: (qmail 26904 invoked by uid 1010); 26 Nov 2019 10:23:11 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f67.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.0/25642. spamassassin: 3.4.2. Clear:RC:0(209.85.166.67):SA:0(-2.0/5.0):. Processed in 1.119838 secs); 26 Nov 2019 10:23:11 -0000 X-Envelope-From: mezin.alexander@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.67 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=T1iJYfKojT/EwwiUZe5yOqq92jNsT8jHCkeSV6hW3x8=; b=qmoglJE4JywVBU8b/29rXw+ZMqDY0zyORIpu+VutUdT6c7hATfUglOPa+JTlhp2Zj+ 3SGjS6W92Ts7DsZ6O0+PEYEjGL/dvPPENvvmW+5q9wuFtGpHQXRkPvUhNrpFFIFcERh2 NdUy3iuGxPUyyc12pN1CWSZUqXXGZgRv3R3WNRfkt2g+gL+fWDnndznBbdF1VAz+erPw hT+XcaziKxmE2RRDpnN0zZyddrOqCPt1gII5cUGNmUjYnMtfMEnqcD0gTuAuiPMTX2nz shryFn6QCDYfAzRNbSKo5iBGSpUXdK0nHXPkThXCwyjvb+SFlnW7D7h3LjCooOg8MJq7 Ggow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=T1iJYfKojT/EwwiUZe5yOqq92jNsT8jHCkeSV6hW3x8=; b=RLPPcNamJLlKBZy7tqQQR9UKsvE/v1mnh/DEco09/BoWqudlxPzH46kJ7vHPOZdtfD 2fwsXeCxZTAClcoav/TOx4v9uxnfTj9x/CGZSIyD2+rPCt+6d23IJiE7k9kJBFtThEqu jH3zZ27iBEQKP7RnJ7qvgwqKWSuLc4MjymACEs3uYW5oIjox/QIv6xLoFLjL67tZF/TY PWnM6cSAchYhIgwveOWjq2G+lQ9J6SCar9I5E+cBa4zu1zU+xVsw5Hi7Gejh08VTgdFT Qvg8CamfmEw8hyxQfZjFtqW29MgsXmbXa1Ng80c/C6vBvlvV4kC7ZSYlF0lYG91xpEeA Ye+w== X-Gm-Message-State: APjAAAUtSo7sBYZXFWBarv++yNg2gex2lc6MfHwn6ln7+b+G9e7AyjUB fvWktc2aZPpUU6ppusqKx+kaftniahKtt1Up8wmfAkcyX0A= X-Google-Smtp-Source: APXvYqxCme6UV3ifColqo2VU0QztGis4d3zEzQEppViCmN0OV9zrwbTpqcTPEBLvBdCJaW/v119lqbq4KyCxTFHDda8= X-Received: by 2002:a05:6602:2181:: with SMTP id b1mr31810681iob.208.1574763757287; Tue, 26 Nov 2019 02:22:37 -0800 (PST) MIME-Version: 1.0 References: <20191123221443.279556-1-mezin.alexander@gmail.com> <20191123221443.279556-3-mezin.alexander@gmail.com> <20191125043525.lcxm532gi6hb7n53@tarpaulin.shahaf.local2> <9438ca11-d0be-4c67-a5b3-a0b900342302@www.fastmail.com> In-Reply-To: <9438ca11-d0be-4c67-a5b3-a0b900342302@www.fastmail.com> From: Aleksandr Mezin Date: Tue, 26 Nov 2019 16:22:26 +0600 Message-ID: Subject: Re: [PATCH 2/3] vcs_info/cvs: set vcs_comm[basedir] in VCS_INFO_detect_cvs To: Daniel Shahaf Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Nov 26, 2019 at 10:52 AM Daniel Shahaf wro= te: > > Aleksandr Mezin wrote on Tue, 26 Nov 2019 01:28 +00:00: > > On Tue, Nov 26, 2019 at 7:26 AM Aleksandr Mezin > > wrote: > > > > > > On Mon, Nov 25, 2019 at 2:17 PM Daniel Shahaf wrote: > > > > Two, as I pointed out in reply to an offlist response, the existenc= e of > > > > $GIT_DIR and $GIT_WORK_TREE means that the two VCS's basedirs need = not > > > > be in a parent dir =E2=80=93 subdir relationship with each other; t= hey can be > > > > /foo/bar and /foo/baz. > > > > > > How is it possible? > > % cd "$(mktemp -d)" > % hg init foo > % git init bar > % cd foo > [shows hg info] > % export GIT_WORK_TREE=3D${PWD/foo/bar} GIT_DIR=3D${PWD/foo/bar}/.git > [shows git info] > % Interesting. I didn't notice that GIT_INFO_detect_git checks the exit code of `git rev-parse --is-inside-work-tree`, not the actual value. You don't even need to set GIT_WORK_TREE, GIT_DIR is enough. But should it work like that? > > > > in a git repository > > > > > > $ GIT_WORK_TREE=3D../other-dir git rev-parse --is-inside-work-tre= e > > > false > > > > > > Work tree root should be a parent of cwd, otherwise `rev-parse > > > --is-inside-work-tree` returns false -> git repository not detected. > > > And there is only one path from cwd to the root -> all parents of cwd > > > are parents or subdirs to each other. > > > > I meant "there is only one path from cwd to /" in the last sentence. > > > > Cheers, > > Daniel