Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH 2/3] vcs_info/cvs: set vcs_comm[basedir] in VCS_INFO_detect_cvs
- X-seq: zsh-workers 44930
- From: "Daniel Shahaf" <d.s@xxxxxxxxxxxxxxxxxx>
- To: "Aleksandr Mezin" <mezin.alexander@xxxxxxxxx>
- 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
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=mime-version:message-id:in-reply-to :references:date:from:to:cc:subject:content-type :content-transfer-encoding; s=fm1; bh=b9H3zttzZ+UT8KJG9UPRtVrPv8 9zzX2GPqqsoxsZ8tA=; b=snSYMY9a7XrMMMNgsEj5zjPinQCARk6B4KInuRcPZH VOOFKSUa6t0owpyswi4U3j2BzzQVrycBqBJ9dIqjX1dOQ4XfKHpEK6UG1WWcvDVS vEQiQVxkz/55TnR6ahuMciCBn2fHWs/0pOn9WQj9urqWEbt4ogTdKAdMTzS+PTwl 8zszCUCMRDUfHsaEteiFojK/67hU7JFvsz7tbn5PJ1IkERDDmzj7NjMNRjMiYKtc oG9cKQpUqaoRZXNdJaJ7+WTIYNZ7W8J/AldxtWGrFAORFPWhOOGtvMeqGkC883Ue ri5uGGXLeF504wh9swqpWzZ+mSHJu5nAoQloUosGnPnw==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=b9H3zttzZ+UT8KJG9UPRtVrPv89zzX2GPqqsoxsZ8 tA=; b=PY+NJkUiOLy9253EV5ZomyO0ZWG961BVqwb+Is1S3SyNUpseQaAQ/MXoQ djV+l3I36powyCKGRz/TiWdKioNbt4IB/ppcZim1mesJ/LfujiV4pPMfcZtkBI+9 9WzAQCojasrEzL+8P60BLJTiBzSMDiF5Ee839t13bWOHl89GqD9Z5dpi5JnBxhVC EjFl/mZeypOiDTiYU6wkXtJI9UmHIzcXOqBCS8QCSk/1c8eKcr2wked5Dr5eWloY UuXFf3McBlgCCgIQJZJcrEhf+6FuBYF+leU/5ETXNbiGx3uzzvBTt96PV9P5WG8C reJ/b5nY8eTG5Od6IXaPqGxAx/A5A==
- In-reply-to: <CADnvcfJsh2zvSDNoCknSxXv3PGsYG9dK5-WGGYoMLQx9aDKdKQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20191123221443.279556-1-mezin.alexander@gmail.com> <20191123221443.279556-3-mezin.alexander@gmail.com> <20191125043525.lcxm532gi6hb7n53@tarpaulin.shahaf.local2> <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@xxxxxxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author