From 0c8625299ae79759ef909c0909b8f7e9b9003d30 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 10 Mar 2013 12:47:39 +0000 Subject: 30639: Add support for showing the current action is cherry-pick to vcs_info git backend --- Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Functions/VCS_Info') diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git index e40571a0e..787e76302 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git @@ -52,6 +52,17 @@ VCS_INFO_git_getaction () { printf '%s' "bisect" return 0 fi + + if [[ -f "${gitdir}/CHERRY_PICK_HEAD" ]] ; then + if [[ -d "${gitdir}/sequencer" ]] ; then + gitaction=cherry-seq + else + gitaction=cherry + fi + printf '%s' ${gitaction} + return 0 + fi + return 1 } -- cgit v1.2.3 From 44907223ff14d424dbfcec4871e41053a07a1dc7 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 10 Mar 2013 13:18:32 +0000 Subject: 31136: vcs_info: just set parameters instead of passing over a pipe --- ChangeLog | 5 ++++- Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 21 +++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'Functions/VCS_Info') diff --git a/ChangeLog b/ChangeLog index a586be32f..4c3351517 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,9 @@ Add support for showing the current action is cherry-pick (happens when cherry-picking a range). + * 31136: Functions/VCS_Info/Backends/VCS_INFO_get_data_git: + just set parameters instead of passing over a pipe. + 2013-03-05 Peter Stephenson * users/17666: Doc/Zsh/contrib.yo, Functions/Misc/zcalc: -f @@ -574,5 +577,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5815 $ +* $Revision: 1.5816 $ ***************************************************** diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git index 787e76302..3f643a21f 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git @@ -5,10 +5,10 @@ setopt localoptions extendedglob NO_shwordsplit local gitdir gitbase gitbranch gitaction gitunstaged gitstaged gitsha1 local stgitpatch stgitunapplied -local -xA hook_com +local -A hook_com VCS_INFO_git_getaction () { - local gitaction='' gitdir=$1 + local gitdir=$1 local tmp for tmp in "${gitdir}/rebase-apply" \ @@ -22,7 +22,6 @@ VCS_INFO_git_getaction () { else gitaction="am/rebase" fi - printf '%s' ${gitaction} return 0 fi done @@ -30,7 +29,7 @@ VCS_INFO_git_getaction () { for tmp in "${gitdir}/rebase-merge/interactive" \ "${gitdir}/.dotest-merge/interactive" ; do if [[ -f "${tmp}" ]] ; then - printf '%s' "rebase-i" + gitaction="rebase-i" return 0 fi done @@ -38,18 +37,18 @@ VCS_INFO_git_getaction () { for tmp in "${gitdir}/rebase-merge" \ "${gitdir}/.dotest-merge" ; do if [[ -d "${tmp}" ]] ; then - printf '%s' "rebase-m" + gitaction="rebase-m" return 0 fi done if [[ -f "${gitdir}/MERGE_HEAD" ]] ; then - printf '%s' "merge" + gitaction="merge" return 0 fi if [[ -f "${gitdir}/BISECT_LOG" ]] ; then - printf '%s' "bisect" + gitaction="bisect" return 0 fi @@ -59,7 +58,6 @@ VCS_INFO_git_getaction () { else gitaction=cherry fi - printf '%s' ${gitaction} return 0 fi @@ -67,7 +65,7 @@ VCS_INFO_git_getaction () { } VCS_INFO_git_getbranch () { - local gitbranch gitdir=$1 tmp actiondir + local gitdir=$1 tmp actiondir local gitsymref="${vcs_comm[cmd]} symbolic-ref HEAD" actiondir='' @@ -106,12 +104,11 @@ VCS_INFO_git_getbranch () { fi fi - printf '%s' "${gitbranch}" return 0 } gitdir=${vcs_comm[gitdir]} -gitbranch="$(VCS_INFO_git_getbranch ${gitdir})" +VCS_INFO_git_getbranch ${gitdir} if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-revision ; then gitsha1=$(${vcs_comm[cmd]} rev-parse --quiet --verify HEAD) else @@ -134,7 +131,7 @@ if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" "check-for-changes" && \ fi VCS_INFO_adjust -gitaction="$(VCS_INFO_git_getaction ${gitdir})" +VCS_INFO_git_getaction ${gitdir} gitbase=${PWD%/${$( ${vcs_comm[cmd]} rev-parse --show-prefix )%/##}} rrn=${gitbase:t} -- cgit v1.2.3 From 88599a0508d584c8e899dc74640b5d58d3ec03c6 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Tue, 18 Jun 2013 08:39:30 +0200 Subject: 31485: vcs_info, git: Avoid error messages for `guilt' users Guilt uses the same internal directory for keeping state as stgit, but it doesn't use the same files (not surprisingly). This caused error messages due to missing files. This fixes that by making the "stgit-active?" test stricter. Reported-by: Axel Beckert --- ChangeLog | 5 +++++ Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'Functions/VCS_Info') diff --git a/ChangeLog b/ChangeLog index 6eb3d873a..b9d210269 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-06-18 Frank Terbeck + + * 31485: Functions/VCS_Info/Backends/VCS_INFO_get_data_git: + vcs_info, git: Avoid error messages for `guilt' users + 2013-06-13 Peter Stephenson * 31465: Completion/compinit, Src/glob.c, Src/pattern.c: fix diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git index 3f643a21f..c44be398e 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git @@ -136,7 +136,9 @@ gitbase=${PWD%/${$( ${vcs_comm[cmd]} rev-parse --show-prefix )%/##}} rrn=${gitbase:t} local patchdir=${gitdir}/patches/${gitbranch} -if [[ -d $patchdir ]] ; then +if [[ -d $patchdir ]] && [[ -f $patchdir/applied ]] \ + && [[ -f $patchdir/unapplied ]] +then local -a stgit_applied stgit_unapplied stgit_all stgit_applied=(${(f)"$(< "${patchdir}/applied")"}) -- cgit v1.2.3