<commit_before>ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%}›%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%b %{$fg[yellow]%}…%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_AHEAD="%b %{$fg[yellow]%}↑%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_BEHIND="%b %{$fg[yellow]%}↓%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_STASH="%b %{$fg[yellow]%}█%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_STAGED="%b %{$fg[yellow]%}♦%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CHANGED="%b %{$fg[yellow]%}‣%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNMERGED="%b %{$fg[yellow]%}≠%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%b"
ZSH_THEME_GIT_PROMPT_SHA_BEFORE="%b "

ZSH_THEME_SVN_PROMPT_DIRTY="%b %{$fg[yellow]%}✗%{$reset_color%}"

function git_prompt_info() {
  ref=$(git symbolic-ref -q HEAD 2> /dev/null) || $(git name-rev --name-only --no-undefined --always HEAD 2> /dev/null) || return
  echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(git_prompt_short_sha)$(parse_git_dirty)$(git_prompt_ahead)$(git_prompt_behind)$(git_prompt_stash)$(git_prompt_staged)$(git_prompt_changed)$ZSH_THEME_GIT_PROMPT_SUFFIX"
}

function git_prompt_ahead() {
  if $(echo "$(git log $(git_current_upstream)/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
    echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
  fi
}

function git_prompt_behind() {
  if $(echo "$(git log HEAD..$(git_current_upstream)/$(current_branch) 2> /dev/null)" | grep '^commit' &> /dev/null); then
    echo "$ZSH_THEME_GIT_PROMPT_BEHIND"
  fi
}

function git_prompt_stash() {
  if $(echo "$(git stash list 2> /dev/null)" | grep '^stash' &> /dev/null); then
    echo "$ZSH_THEME_GIT_PROMPT_STASH"
  fi
}

function git_prompt_staged() {
  if test $(git diff --staged --name-only --diff-filter=ACDMRT | wc -l) -gt "0"; then
    echo "$ZSH_THEME_GIT_PROMPT_STAGED"
  fi
}

function git_prompt_changed() {
  if test $(git diff --name-only --diff-filter=ACDMRT | wc -l) -gt "0"; then
    echo "$ZSH_THEME_GIT_PROMPT_CHANGED"
  fi
}

function git_prompt_unmerged() {
  if test $(git diff --staged --name-only --diff-filter=U | wc -l) -gt "0"; then
    echo "$ZSH_THEME_GIT_PROMPT_UNMERGED"
  fi
}

function git_current_upstream(){
  local upstream=$(git config --get branch."$(current_branch)".remote) || return
  echo $upstream
}

function prompt_info() {
  # only proceed if there is actually a svn repository
  if [ $(in_svn) ]; then
    svn_prompt_info
  else
    git_prompt_info
  fi
}

function current_pwd {
  # echo $(pwd | awk -F\/ '{print $(NF-1),$(NF)}' | sed 's/ /\//')
  # echo $(pwd | sed -e "s,^$HOME,~,")
  pwd_length=14
  pwd_symbol="..."
  newPWD="${PWD/#$HOME/~}"
  if [ $(echo -n $newPWD | wc -c | tr -d " ") -gt $pwd_length ]
  then
    newPWD=$(echo -n $newPWD | awk -F '/' '{
    print $1 "/" $2 "/.../" $(NF-1) "/" $(NF)}')
  fi
    echo $newPWD
}

local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"

local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
local current_dir='%{$terminfo[bold]$fg[yellow]%} $(current_pwd)%{$reset_color%}'
local rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v p g)›%{$reset_color%}'
# local rvm_ruby='%{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}'
local rev_info='$(prompt_info)%{$reset_color%}'
<commit_msg>Improve current path in prompt<commit_after>ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%}›%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%b %{$fg[yellow]%}…%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_AHEAD="%b %{$fg[yellow]%}↑%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_BEHIND="%b %{$fg[yellow]%}↓%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_STASH="%b %{$fg[yellow]%}█%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_STAGED="%b %{$fg[yellow]%}♦%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CHANGED="%b %{$fg[yellow]%}‣%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNMERGED="%b %{$fg[yellow]%}≠%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%b"
ZSH_THEME_GIT_PROMPT_SHA_BEFORE="%b "

ZSH_THEME_SVN_PROMPT_DIRTY="%b %{$fg[yellow]%}✗%{$reset_color%}"

function git_prompt_info() {
  ref=$(git symbolic-ref -q HEAD 2> /dev/null) || $(git name-rev --name-only --no-undefined --always HEAD 2> /dev/null) || return
  echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(git_prompt_short_sha)$(parse_git_dirty)$(git_prompt_ahead)$(git_prompt_behind)$(git_prompt_stash)$(git_prompt_staged)$(git_prompt_changed)$ZSH_THEME_GIT_PROMPT_SUFFIX"
}

function git_prompt_ahead() {
  if $(echo "$(git log $(git_current_upstream)/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
    echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
  fi
}

function git_prompt_behind() {
  if $(echo "$(git log HEAD..$(git_current_upstream)/$(current_branch) 2> /dev/null)" | grep '^commit' &> /dev/null); then
    echo "$ZSH_THEME_GIT_PROMPT_BEHIND"
  fi
}

function git_prompt_stash() {
  if $(echo "$(git stash list 2> /dev/null)" | grep '^stash' &> /dev/null); then
    echo "$ZSH_THEME_GIT_PROMPT_STASH"
  fi
}

function git_prompt_staged() {
  if test $(git diff --staged --name-only --diff-filter=ACDMRT | wc -l) -gt "0"; then
    echo "$ZSH_THEME_GIT_PROMPT_STAGED"
  fi
}

function git_prompt_changed() {
  if test $(git diff --name-only --diff-filter=ACDMRT | wc -l) -gt "0"; then
    echo "$ZSH_THEME_GIT_PROMPT_CHANGED"
  fi
}

function git_prompt_unmerged() {
  if test $(git diff --staged --name-only --diff-filter=U | wc -l) -gt "0"; then
    echo "$ZSH_THEME_GIT_PROMPT_UNMERGED"
  fi
}

function git_current_upstream(){
  local upstream=$(git config --get branch."$(current_branch)".remote) || return
  echo $upstream
}

function prompt_info() {
  # only proceed if there is actually a svn repository
  if [ $(in_svn) ]; then
    svn_prompt_info
  else
    git_prompt_info
  fi
}

function current_pwd {
  pwd_length=4
  pwd_symbol="..."
  newPWD="${PWD/#$HOME/~}"
  if [ $(echo -n $newPWD | tr -d -c '/' | awk '{ print length; }') -gt $pwd_length ]

  then
    newPWD=$(echo -n $newPWD | awk -F '/' '{print $1 "/" $2 "/" $3 "/.../" $(NF-1) "/" $(NF)}')
  fi
    echo $newPWD
}

local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"

local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
local current_dir='%{$terminfo[bold]$fg[yellow]%} $(current_pwd)%{$reset_color%}'
local rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v p g)›%{$reset_color%}'
# local rvm_ruby='%{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}'
local rev_info='$(prompt_info)%{$reset_color%}'

{'fraction_non_alphanumeric': 0.2071848869619077, 'fraction_numerical': 0.004180860947661815, 'mean_word_length': 5.584097859327217, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1350104', 'n_tokens_mistral': 2975, 'n_tokens_neox': 2831, 'n_words': 454}