zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH 0/3] vcs_info: handle nested repositories of different types
@ 2019-11-23 22:14 Aleksandr Mezin
  2019-11-23 22:14 ` [PATCH 1/3] vcs_info/git: set vcs_comm[basedir] in VCS_INFO_detect_git Aleksandr Mezin
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Aleksandr Mezin @ 2019-11-23 22:14 UTC (permalink / raw)
  To: zsh-workers; +Cc: Aleksandr Mezin

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


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2019-11-29 20:53 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-23 22:14 [PATCH 0/3] vcs_info: handle nested repositories of different types Aleksandr Mezin
2019-11-23 22:14 ` [PATCH 1/3] vcs_info/git: set vcs_comm[basedir] in VCS_INFO_detect_git Aleksandr Mezin
2019-11-23 22:14 ` [PATCH 2/3] vcs_info/cvs: set vcs_comm[basedir] in VCS_INFO_detect_cvs Aleksandr Mezin
2019-11-25  4:35   ` Daniel Shahaf
2019-11-25  7:31     ` Aleksandr Mezin
2019-11-25  8:16       ` Daniel Shahaf
2019-11-26  1:26         ` Aleksandr Mezin
2019-11-26  1:28           ` Aleksandr Mezin
2019-11-26  4:52             ` Daniel Shahaf
2019-11-26 10:22               ` Aleksandr Mezin
2019-11-28 11:13                 ` Daniel Shahaf
2019-11-28 21:34                   ` Daniel Shahaf
2019-11-29 13:41                     ` Aleksandr Mezin
2019-11-29 15:25                       ` Mikael Magnusson
2019-11-29 19:55                         ` Daniel Shahaf
2019-11-29 20:30                       ` Daniel Shahaf
2019-11-29 20:52                         ` Daniel Shahaf
2019-11-25  9:13       ` Bart Schaefer
2019-11-25 18:22         ` Daniel Shahaf
2019-11-25 18:47           ` Bart Schaefer
2019-11-23 22:14 ` [PATCH 3/3] vcs_info: choose the nearest repository Aleksandr Mezin
2019-11-25  4:33   ` Daniel Shahaf

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).