summaryrefslogtreecommitdiff
path: root/net:foret
diff options
context:
space:
mode:
authorHugues Hiegel <hugues.hiegel@qosmos.com>2013-08-07 15:43:20 +0200
committerHugues Hiegel <hugues.hiegel@qosmos.com>2013-08-07 15:43:20 +0200
commitcbd65134a8afb2b1fc28419fd95f257287f81e89 (patch)
tree25e8eeff68716834bf80b1a48cc515dacb2c665b /net:foret
parent5cef725a76808a81e58248f79e1404ca8a7e008a (diff)
[Git] Updates…
Diffstat (limited to 'net:foret')
-rw-r--r--net:foret/Prompts.zsh22
1 files changed, 22 insertions, 0 deletions
diff --git a/net:foret/Prompts.zsh b/net:foret/Prompts.zsh
index 8a6f2b7..fc8962c 100644
--- a/net:foret/Prompts.zsh
+++ b/net:foret/Prompts.zsh
@@ -83,3 +83,25 @@ __makeflags ()
PS1_TASKBAR+=(__makeflags __verbose_compilation __nproc_compilation)
PS1_EXTRA_INFO+=(__static_dynamic __compilation_os __compilation_arch __compilation_target)
+__subvcsbranches () {
+ local GITBRANCH
+
+ GIT_DIR=$(git rev-parse --git-dir 2>/dev/null)
+ [ "$( ( git ls-files ; git ls-tree HEAD . ) 2>&- | head -n1)" = "" -a \
+ \( ! -d .git -o -z "$GIT_DIR" \) -a \
+ "$(git rev-parse --is-inside-git-dir 2>&-)" != "true" ] && return
+
+ # Get recursive submodules statuses
+ for SUBMODULE in $(git config --get zsh.recurse-dirs)
+ do
+ if [ -d $(dirname $GIT_DIR)/$SUBMODULE ]
+ then
+ GITBRANCH+=${GITBRANCH:+$(tput cuf1)}
+ GITBRANCH+=$C_$_prompt_colors[bar]$_C"["
+ GITBRANCH+=$(__get_git_fullstatus $(dirname $GIT_DIR)/$SUBMODULE | sed 's/_for_\(ixm\|df\)/’/g')
+ GITBRANCH+=$C_$_prompt_colors[bar]$_C"]"
+ fi
+ done
+ echo $GITBRANCH
+
+}