summaryrefslogtreecommitdiff
path: root/12_Prompts.zsh
diff options
context:
space:
mode:
authorHugues Hiegel <hugues.hiegel@qosmos.com>2013-08-05 18:48:47 +0200
committerHugues Hiegel <hugues.hiegel@qosmos.com>2013-08-05 18:58:17 +0200
commit3d6a612651035f831ea3049747e4a1dcd6d879ed (patch)
tree4930e066275162f42d2802517bdd2f2d9846ad86 /12_Prompts.zsh
parentc44a4e6ca8e10a017e34f8045b454824951983cc (diff)
[Git] New stuff : gets « git config core.recursive » folders to get sub-branches statuses
Diffstat (limited to '12_Prompts.zsh')
-rw-r--r--12_Prompts.zsh13
1 files changed, 13 insertions, 0 deletions
diff --git a/12_Prompts.zsh b/12_Prompts.zsh
index 55b816e..6afbc09 100644
--- a/12_Prompts.zsh
+++ b/12_Prompts.zsh
@@ -245,6 +245,19 @@ __vcsbranch ()
if [ -n "$GITBRANCH" ]
then
GITBRANCH=$C_$_prompt_colors[soft_generic]$_C${${GITBRANCH/→/$C_"$(__get_git_status)"$_C}/←/$C_$_prompt_colors[soft_generic]$_C}"$(__get_guilt_series)$C_$color[none]$_C"
+
+ # Get recursive submodules statuses
+ GIT_DIR=$(git rev-parse --git-dir)
+ for SUBMODULE in $(git config --get core.recursive)
+ do
+ pushd $(dirname $GIT_DIR)/$SUBMODULE >/dev/null
+ SUBBRANCH=${$(__get_git_branch)//→master←/→…←}
+ SUBSTATUS=$(__get_git_status)
+ popd >/dev/null
+ GITBRANCH+=$C_$color[black]$_C"₊"$C_$_prompt_colors[soft_generic]$_C
+ GITBRANCH+=${${SUBBRANCH/→/$C_"$SUBSTATUS"$_C}/←/$C_$_prompt_colors[soft_generic]$_C}
+ GITBRANCH+=$C_$color[none]$_C
+ done
fi