Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] vcs_info: add 'find-deepest' zstyle



Daniel Shahaf wrote:
> Aleksandr Mezin wrote on Fri, 23 Oct 2020 14:34 +0600:
>> Currently, vcs_info iterates over enabled VCS backends and outputs repository
>> status from the first backend that works (i.e. first backend that can find a
>> repository).
>> 
>> But I prefer a different behavior: I want to see the status of the repository
>> closest to the current working directory. For example: if there is a Mercurial
>> repository inside a Git repository, and I 'cd' into the Mercurial repository,
>> I want to see the status of Mercurial repo, even if 'git' comes before 'hg' in
>> the 'enable' list.
>
> I suppose that's the Right thing to do in most cases: e.g., it's
> context-sensitive whereas the 'enable' style's value doesn't usually
> depend on the current directory.
>
> (Separately, in your example it might be nice to indicate that there's
> an "outside" Git repository, but that'd be a separate feature request.)
>
>> Because some people, apparently, want the old behavior of vcs_info,
>
> What's those people's argument?  The default behaviour should be decided
> on on this list, not simply announced to this list as a _fait accompli_.

I, for one,  vastly prefer the current behaviour. I  don't think nesting
repositories is  all that common. Even  when I was using  many different
systems, never did I have a need for that.

The most common reason  I heard in the past, when this  came up is, wan-
ting to keep all of $HOME in git, which I consider borderline insane.

What the  current behaviour permits  is to set  the enable style  in the
order  of probability.  That way  the most  common system  you use  gets
checked first, cutting down on detection time. Since some systems take a
fair bit of time  to do detection, I deemed this  reasonable at the time
this was written. And like I said,  I think this is still the preferable
default choice.

I skimmed over the  patch and I like the limited  amount of changes that
are required  to get  the other  behaviour. So  I think  something along
those lines should go in. But I'd prefer the default as it is.


Regards, Frank




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