<commit_before>
set -xg __fish_vcs_prompt_color yellow

function __vcs_info --description "Print a vcs prompt - supports git and hg"
  # find out if we're in a git or hg repo by looking for the control dir
  set -l d $PWD
  set -l git
  set -l hg

  while true
    if test -d "$d/.git"
      set git $d
      break
    else if test -d "$d/.hg"
      set hg $d
      break
    end
    if test "$d" = /
      break
    end
    # portable "realpath" equivalent
    set d (cd "$d/.."; and echo "$PWD")
  end

  set -l br
  if test -n "$hg"
    set -l file
    for file in "$hg/.hg/bookmarks.current" "$hg/.hg/branch"
      if test -f "$file"
        read br < "$file"
        break
      end
    end
  else if test -n "$git"
    if test -f "$git/.git/HEAD"
      read br < "$git/.git/HEAD"
      switch $br
        case 'ref: refs/heads/*'<commit_msg>fix the bug in which prompt always goes to /<commit_after>
set -xg __fish_vcs_prompt_color yellow

function __vcs_info --description "Print a vcs prompt - supports git and hg"
  # find out if we're in a git or hg repo by looking for the control dir
  set -l d $PWD
  set -l git
  set -l hg

  while true
    if test -d "$d/.git"
      set git $d
      break
    else if test -d "$d/.hg"
      set hg $d
      break
    end
    if test "$d" = /
      break
    end
    set d ($d/..; and echo "$PWD")
  end

  set -l br
  if test -n "$hg"
    set -l file
    for file in "$hg/.hg/bookmarks.current" "$hg/.hg/branch"
      if test -f "$file"
        read br < "$file"
        break
      end
    end
  else if test -n "$git"
    if test -f "$git/.git/HEAD"
      read br < "$git/.git/HEAD"
      switch $br
        case 'ref: refs/heads/*'
{'fraction_non_alphanumeric': 0.11764705882352941, 'fraction_numerical': 0.0, 'mean_word_length': 1.7337662337662338, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '4678299', 'n_tokens_mistral': 625, 'n_tokens_neox': 603, 'n_words': 244}