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

[PATCH 0/3] vcs_info: handle nested repositories of different types



I've noticed that vcs_info doesn't correctly handle the case when a repository
of one type is nested inside of a repository of another type.

Example:
 - git repository in ~/git-repo
 - hg repository in ~/git-repo/hg-repo (it's not a submodule)
 - vcs_info called in ~/git-repo/hg-repo will output information about git-repo

To fix this, I've made following changes:
 - Modified VCS_INFO_detect_{git,cvs} to set vcs_comm[basedir] (other backends
do it)
 - Modified vcs_info to choose the repository with the longest vcs_comm[basedir]
(as an absolute path)

However, this logic may not work correctly for symlinked repositories, if
VCS_INFO_detect_* functions will continue to use :P modifier for the basedir.
Is there a reason why :P is used for basedir instead of :a?

Aleksandr Mezin (3):
  vcs_info/git: set vcs_comm[basedir] in VCS_INFO_detect_git
  vcs_info/cvs: set vcs_comm[basedir] in VCS_INFO_detect_cvs
  vcs_info: choose the nearest repository

 .../VCS_Info/Backends/VCS_INFO_detect_cvs     | 11 ++++++++--
 .../VCS_Info/Backends/VCS_INFO_detect_git     |  1 +
 .../VCS_Info/Backends/VCS_INFO_get_data_cvs   |  6 +-----
 .../VCS_Info/Backends/VCS_INFO_get_data_git   |  2 +-
 Functions/VCS_Info/vcs_info                   | 21 +++++++++++++------
 5 files changed, 27 insertions(+), 14 deletions(-)

-- 
2.24.0



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