diff options
author | Hugues Hiegel <hugues.hiegel@qosmos.com> | 2013-08-05 18:48:47 +0200 |
---|---|---|
committer | Hugues Hiegel <hugues.hiegel@qosmos.com> | 2013-08-05 18:58:17 +0200 |
commit | 3d6a612651035f831ea3049747e4a1dcd6d879ed (patch) | |
tree | 4930e066275162f42d2802517bdd2f2d9846ad86 /12_Prompts.zsh | |
parent | c44a4e6ca8e10a017e34f8045b454824951983cc (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.zsh | 13 |
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 |