zsh-workers
 help / color / mirror / code / Atom feed
From: "Daniel Shahaf" <d.s@daniel.shahaf.name>
To: "Aleksandr Mezin" <mezin.alexander@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH 2/3] vcs_info/cvs: set vcs_comm[basedir] in VCS_INFO_detect_cvs
Date: Mon, 25 Nov 2019 08:16:45 +0000	[thread overview]
Message-ID: <e4246cb5-863e-4628-beca-4698ab057480@www.fastmail.com> (raw)
In-Reply-To: <CADnvcfJsh2zvSDNoCknSxXv3PGsYG9dK5-WGGYoMLQx9aDKdKQ@mail.gmail.com>

Aleksandr Mezin wrote on Mon, 25 Nov 2019 07:31 +00:00:
> On Mon, Nov 25, 2019 at 10:35 AM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> >
> > Aleksandr Mezin wrote on Sun, Nov 24, 2019 at 04:14:42 +0600:
> > > +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_cvs
> > > @@ -5,11 +5,7 @@
> > > -cvsbase="."
> > > -while [[ -d "${cvsbase}/../CVS" ]]; do
> > > -    cvsbase="${cvsbase}/.."
> > > -done
> > > +++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_cvs
> > > @@ -7,5 +7,12 @@ setopt localoptions NO_shwordsplit
> > > +local cvsbase="."
> > > +while [[ -d "${cvsbase}/../CVS" ]]; do
> > > +    cvsbase="${cvsbase}/.."
> > > +done
> >
> > I know you just moved this code around, but I'd like to point out that it
> > causes an infinite loop when /CVS exists.
> 
> Also I probably shouldn't have moved the code in the first place. If
> the current directory has `CVS/Repository` in it, it means that the
> directory is controlled by CVS, and maybe we shouldn't consider .git
> from the parent directory (even when the parent directory also has
> `CVS/Repository` in it). Though it's questionable.
> 
> Example:
> ~/cvs-dir/CVS/Repository
> ~/cvs-dir/git-repo/.git
> ~/cvs-dir/git-repo/CVS/Repository
> ~/cvs-dir/git-repo/cvs-subdir/CVS/Repository
> 
> I'm not sure what vcs_info should output for ~/cvs-dir/git-repo/cvs-subdir/

How about showing the information from the worktree whose root is deeper
(= closer to cwd)?  Users can show the information for the other worktree
by setting the 'enable' style in a :vcs_info:foo:* context and calling
«vcs_info foo».

I see two possible problems:

One, the workaround isn't sufficient when the two worktrees are of the
same VCS (for example, git and git, as opposed to git and CVS) — that
is, when foo/.$vcs and foo/bar/.$vcs both exist as separate, nested
worktrees.  However, this use-case isn't well-supported by all
VCS's.  For example, which worktree «cd foo && $vcs add bar/baz» will
take effect in is anyone's guess.

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.  At that point, we won't be able to use worktree
root paths as discriminators.  Re-reading PEP 20, I think "Information will be
shown for whichever VCS is listed first in the 'enable' style" might be a sensible
design… but it's a puzzler.

Cheers,

Daniel

  reply	other threads:[~2019-11-25  8:17 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 [this message]
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
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=e4246cb5-863e-4628-beca-4698ab057480@www.fastmail.com \
    --to=d.s@daniel.shahaf.name \
    --cc=mezin.alexander@gmail.com \
    --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).