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

Re: [PATCH v4] vcs_info: choose backend by basedir



Aleksandr Mezin wrote on Sun, Nov 15, 2020 at 01:37:03 +0600:
> Also, this patch adjusts VCS_INFO_detect_git and VCS_INFO_detect_cvs to make
> them set vcs_comm[basedir], by moving basedir detection code from corresponding
> VCS_INFO_get_data_* functions. VCS_INFO_detect_git and VCS_INFO_detect_cvs were
> the only VCS_INFO_detect_* functions not setting it.

I've committed this part.  The code wasn't wrong, but consistency
between backends is a good thing to have.

> +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
> @@ -138,7 +138,7 @@ VCS_INFO_git_handle_patches () {
>  
>  gitdir=${vcs_comm[gitdir]}
>  VCS_INFO_git_getbranch ${gitdir}

It seems to me this call should be moved below the assignment of rrn, in
case VCS_INFO_detect_git ever wants to query zstyles.  (preëxisting issue)

> -gitbase=$( ${vcs_comm[cmd]} rev-parse --show-toplevel 2> /dev/null )
> +gitbase=${vcs_comm[basedir]}
>  if [[ -z ${gitbase} ]]; then
>      # Bare repository
>      gitbase=${gitdir:P}

(Haven't forgotten about the non-drive-by part of the patch, either.)

Cheers,

Daniel




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