summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues.hiegel@qosmos.com>2013-11-13 17:21:04 +0100
committerHugues Hiegel <hugues.hiegel@qosmos.com>2013-11-13 17:21:04 +0100
commit21fd31d52bc1c2dd8b90f81a560a0bf16556b8db (patch)
tree6ec2c75c80bd97490a78983430027d935f7a2f06
parent59afe2a2b500504ace9dfb853f6a8f38c732284b (diff)
[Prompt] Trick or treat ?
-rw-r--r--net:foret/Internal.zsh22
-rw-r--r--net:foret/Prompts.zsh23
2 files changed, 22 insertions, 23 deletions
diff --git a/net:foret/Internal.zsh b/net:foret/Internal.zsh
new file mode 100644
index 0000000..3bf6c65
--- /dev/null
+++ b/net:foret/Internal.zsh
@@ -0,0 +1,22 @@
+
+__get_git_fullstatus ()
+{
+ [ -n "$1" ] && pushd $1 >/dev/null
+
+ local _branch _status _tracking _stashes
+
+ _branch=$(__get_git_branch)
+
+ if [ -n "$_branch" ]
+ then
+ _status=$(__get_git_branch_status)
+ _branch=$C_$_prompt_colors[soft_generic]$_C${${_branch/→/$C_$_status$_C}/←/$C_$_prompt_colors[soft_generic]$_C}$C_$color[none]$_C
+ _tracking=$(__get_git_tracking_status)
+ _stashes=$(__get_git_stashes)
+ fi
+
+ [ -n "$1" ] && popd >/dev/null
+
+ echo $_branch${_tracking:+ $_tracking}${_stashes:+ $_stashes} | sed 's/_for_\(ixm\|df\)/’/g'
+
+}
diff --git a/net:foret/Prompts.zsh b/net:foret/Prompts.zsh
index ec93403..a7d6722 100644
--- a/net:foret/Prompts.zsh
+++ b/net:foret/Prompts.zsh
@@ -82,26 +82,3 @@ __makeflags ()
PS1_TASKBAR+=(__makeflags __verbose_compilation __nproc_compilation __static_dynamic __compilation_os __compilation_arch __compilation_target)
PS1_EXTRA_INFO+=()
-
-__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"[%{%B%}$SUBMODULE%{%b%}:"
- GITBRANCH+=$(__get_git_fullstatus $(dirname $GIT_DIR)/$SUBMODULE | sed 's/_for_\(ixm\|df\)/’/g')
- GITBRANCH+=$C_$_prompt_colors[bar]$_C"]"
- fi
- done
- echo $GITBRANCH
-
-}