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

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

Bart Schaefer wrote on Fri, 23 Oct 2020 17:56 -0700:
> On Fri, Oct 23, 2020 at 5:13 PM Frank Terbeck <ft@xxxxxxx> wrote:
> >
> > 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.  
> At my $WORK we have two related but distinct code bases, an older
> version of the platform that is maintained for several longtime
> customers and the modern version used by all new customers.  The old
> code base is in CVS, the new code base (which incorporates a large
> subset of the old) has been moved to git.  Occasionally there are
> bugfixes that need to be ported from one to the other within that
> shared subset.  Maintaining nested repositories has been useful for
> this situation, but it's difficult to get vcs_info to select the
> correct one.
> That said, I'm not sure "deepest" reflects the right behavior either.
> I'd pretty much need to select the repository that differs from the
> current working file, whichever one that is at the time.

At the risk of veering off-topic, how about running vcs_info twice
(with different argv[1] values for zstyle purposes) and have it print
_both_ the CVS info and git info every prompt.  Something like:

precmd() {
  print -rPC1 -- $vcs_info_msg_0_
  local tmp=$vcs_info_msg_0_
  vcs_info foo
  if [[ -n $vcs_info_msg_0_ && $vcs_info_msg_0_ != $tmp ]]; then print -rPC1 -- $vcs_info_msg_0_; fi
zstyle ':vcs_info:*:foo:*' enable …



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