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

Re: [PATCH 4/9] vcs_info git: set rrn before using it



On Tue, 16 Sep 2014 22:41:17 +0200
Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:

> Marc Finet wrote:
> [...]
> > diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
> > b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git index
> > 263a325..6231301 100644 ---
> > a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git +++
> > b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git @@ -115,6
> > +115,8 @@ VCS_INFO_git_getbranch () { 
> >  gitdir=${vcs_comm[gitdir]}
> >  VCS_INFO_git_getbranch ${gitdir}
> > +gitbase=$( ${vcs_comm[cmd]} rev-parse --show-toplevel )
> > +rrn=${gitbase:t}
> >  if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}"
> > get-revision ; then gitsha1=$(${vcs_comm[cmd]} rev-parse --quiet
> > --verify HEAD)
> [...]
> 
> This patch looks like it was mutilated by MUA. Could you resend? Maybe
> using "git send-email" or if all else fails, the .patch file attached
> to an email?

Should be better now.

Marc [still configuring my "new" machine].

This would fix handling get-revision, check-for-changes or
check-for-staged-changes when set per repository.

---
 Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 263a325..6231301 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -115,6 +115,8 @@ VCS_INFO_git_getbranch () {
 
 gitdir=${vcs_comm[gitdir]}
 VCS_INFO_git_getbranch ${gitdir}
+gitbase=$( ${vcs_comm[cmd]} rev-parse --show-toplevel )
+rrn=${gitbase:t}
 if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-revision ; then
     gitsha1=$(${vcs_comm[cmd]} rev-parse --quiet --verify HEAD)
 else
@@ -154,8 +156,6 @@ fi
 
 VCS_INFO_adjust
 VCS_INFO_git_getaction ${gitdir}
-gitbase=$( ${vcs_comm[cmd]} rev-parse --show-toplevel )
-rrn=${gitbase:t}
 
 local patchdir=${gitdir}/patches/${gitbranch}
 if [[ -d $patchdir ]] && [[ -f $patchdir/applied ]] \
-- 
2.1.0



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