From: Aleksandr Mezin <mezin.alexander@gmail.com>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH 2/3] vcs_info/cvs: set vcs_comm[basedir] in VCS_INFO_detect_cvs
Date: Tue, 26 Nov 2019 16:22:26 +0600 [thread overview]
Message-ID: <CADnvcfJaApTgWv8yTwwHDnNJq3uQ9U2VJMwbRpMgcsuoxVAzYw@mail.gmail.com> (raw)
In-Reply-To: <9438ca11-d0be-4c67-a5b3-a0b900342302@www.fastmail.com>
On Tue, Nov 26, 2019 at 10:52 AM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
>
> Aleksandr Mezin wrote on Tue, 26 Nov 2019 01:28 +00:00:
> > On Tue, Nov 26, 2019 at 7:26 AM Aleksandr Mezin
> > <mezin.alexander@gmail.com> wrote:
> > >
> > > On Mon, Nov 25, 2019 at 2:17 PM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> > > > Two, as I pointed out in reply to an offlist response, the existence of
> > > > $GIT_DIR and $GIT_WORK_TREE means that the two VCS's basedirs need not
> > > > be in a parent dir – subdir relationship with each other; they 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=${PWD/foo/bar} GIT_DIR=${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=../other-dir git rev-parse --is-inside-work-tree
> > > 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
next prev parent reply other threads:[~2019-11-26 10:23 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-23 22:14 [PATCH 0/3] vcs_info: handle nested repositories of different types Aleksandr Mezin
2019-11-23 22:14 ` [PATCH 1/3] vcs_info/git: set vcs_comm[basedir] in VCS_INFO_detect_git Aleksandr Mezin
2019-11-23 22:14 ` [PATCH 2/3] vcs_info/cvs: set vcs_comm[basedir] in VCS_INFO_detect_cvs Aleksandr Mezin
2019-11-25 4:35 ` Daniel Shahaf
2019-11-25 7:31 ` Aleksandr Mezin
2019-11-25 8:16 ` Daniel Shahaf
2019-11-26 1:26 ` Aleksandr Mezin
2019-11-26 1:28 ` Aleksandr Mezin
2019-11-26 4:52 ` Daniel Shahaf
2019-11-26 10:22 ` Aleksandr Mezin [this message]
2019-11-28 11:13 ` Daniel Shahaf
2019-11-28 21:34 ` Daniel Shahaf
2019-11-29 13:41 ` Aleksandr Mezin
2019-11-29 15:25 ` Mikael Magnusson
2019-11-29 19:55 ` Daniel Shahaf
2019-11-29 20:30 ` Daniel Shahaf
2019-11-29 20:52 ` Daniel Shahaf
2019-11-25 9:13 ` Bart Schaefer
2019-11-25 18:22 ` Daniel Shahaf
2019-11-25 18:47 ` Bart Schaefer
2019-11-23 22:14 ` [PATCH 3/3] vcs_info: choose the nearest repository Aleksandr Mezin
2019-11-25 4:33 ` Daniel Shahaf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CADnvcfJaApTgWv8yTwwHDnNJq3uQ9U2VJMwbRpMgcsuoxVAzYw@mail.gmail.com \
--to=mezin.alexander@gmail.com \
--cc=d.s@daniel.shahaf.name \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).