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



Aleksandr Mezin wrote on Tue, 26 Nov 2019 10:22 +00:00:
> On Tue, Nov 26, 2019 at 10:52 AM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> > % 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.

I think it should check both the exit code and the output.

> You don't even need to set GIT_WORK_TREE, GIT_DIR is enough.

I think it's fine to detect git when GIT_DIR is set.  After all, git
commands would work at that point, so it'll be useful to display git
info.  [I mean this in the context of "when should git be detected", not
in the context of "what to do when multiple VCS's are detected".
I think the two questions are independent.]

Cheers,

Daniel
(sorry for late answer; I'm not online much this week)



Messages sorted by: Reverse Date, Date, Thread, Author