<commit_before>#!/bin/sh
#====================================================================================================
#
# Shows git status for all repos
# This must be run from the main "git" directory (the parent of all simulation/chipper repo directories)
# Usage: chipper/bin/status.sh
#
# Author: <NAME>
#
#====================================================================================================

for dir in *
do
  if [ -d "${dir}" ]; then
    cd $dir
    echo "${dir}"
    git status | grep -v nothing | sed -e 's/# On branch master/                                    \x1BM\x1B\[32mmaster\x1B\[0m/' \
                                       -e 's/# On branch \(.*\)$/                                    \x1BM\x1B\[31m\1\x1B\[0m/'
    cd ..
  fi
done<commit_msg>Improving status.sh output<commit_after>#!/bin/sh
#====================================================================================================
#
# Shows git status for all repos
# This must be run from the main "git" directory (the parent of all simulation/chipper repo directories)
# Usage: chipper/bin/status.sh
#
# Author: <NAME>
#
#====================================================================================================

# ANSI escape sequences to move to the right (in the same line) or to apply or reset colors
MOVE_RIGHT="\E[36G"
RED="\E[31m"
GREEN="\E[32m"
YELLOW="\E[33m"
RESET="\E[0m"

for dir in *
do
  # ignore non-directory files
  if [ -d "${dir}" ]; then
    cd $dir
    # ignore directory if it's not a git repo base
    if [ -d .git ]; then
      echo -n "${dir}" # -n for no newline

      # current branch name OR an empty string (if detached head)
      BRANCH=`git symbolic-ref -q HEAD | sed -e 's/refs\/heads\///'`

      # current SHA
      SHA=`git rev-parse HEAD`

      # status (empty string if clean)
      STATUS=`git status --porcelain`

      # if no branch, print our SHA (detached head)
      if [ -z "$BRANCH" ]; then
        echo -e "${MOVE_RIGHT}${RED}${SHA}${RESET}"
      else
        # color branch name based on branch and status. RED for non-master, otherwise GREEN/YELLOW depending on status
        if [ "$BRANCH" = "master" ]; then
          if [ -z "$STATUS" ]; then
            echo -e "${MOVE_RIGHT}${GREEN}master${RESET}"
          else
            echo -e "${MOVE_RIGHT}${YELLOW}master${RESET}"
          fi
        else
          echo -e "${MOVE_RIGHT}${RED}${BRANCH}${RESET}"
        fi
      fi

      # print status, if any
      if [ ! -z "$STATUS" ]; then
        echo "$STATUS"
      fi
    fi
    cd ..
  fi
done
{'fraction_non_alphanumeric': 0.2730799069045772, 'fraction_numerical': 0.008533747090768037, 'mean_word_length': 2.532876712328767, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5164466', 'n_tokens_mistral': 781, 'n_tokens_neox': 726, 'n_words': 242}