<commit_before>#! /usr/bin/env sh
#
# Copyright (c) 2016 <NAME> <<EMAIL>>
#
#
# SBXG is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SBXG is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SBXG  If not, see <http://www.gnu.org/licenses/>.


CWD="$(dirname "$0")" # Where the script resides

# Returns the git version as an integer
git_version_get() {
   echo "$(git --version | grep -o "[0-9]\.[0-9]\.[0-9]" | sed 's/\.//g')"
}

git_remote_get() {
   # FIXME origin is assumed to be the remote
   echo "origin"
}

git_dir="$CWD/../.git"
if [ -d "$git_dir" ]; then
   git_version="$(git_version_get)"
   remote="$(git_remote_get)"

   # Git 2.7.0 provides git remote get-url. Previous versions don't...
   if [ "$git_version" -ge 270 ]; then
      url="$(git --git-dir "$git_dir" remote get-url "$remote")"
   else # < git 2.7.0
      url="$(git remote -v | grep "${remote}.*(fetch)$" | cut -d ' ' -f 1 | cut -f 2)"
   fi
   base_url="$(dirname "$url")"
   echo "$base_url"
else
   exit 1
fi<commit_msg>scripts: remove useless echo<commit_after>#! /usr/bin/env sh
#
# Copyright (c) 2016 <NAME> <<EMAIL>>
#
#
# SBXG is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SBXG is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SBXG  If not, see <http://www.gnu.org/licenses/>.


CWD="$(dirname "$0")" # Where the script resides

# Returns the git version as an integer
git_version_get() {
   git --version | grep -o "[0-9]\.[0-9]\.[0-9]" | sed 's/\.//g'
}

git_remote_get() {
   # FIXME origin is assumed to be the remote
   echo "origin"
}

git_dir="$CWD/../.git"
if [ -d "$git_dir" ]; then
   git_version="$(git_version_get)"
   remote="$(git_remote_get)"

   # Git 2.7.0 provides git remote get-url. Previous versions don't...
   if [ "$git_version" -ge 270 ]; then
      url="$(git --git-dir "$git_dir" remote get-url "$remote")"
   else # < git 2.7.0
      url="$(git remote -v | grep "${remote}.*(fetch)$" | cut -d ' ' -f 1 | cut -f 2)"
   fi
   base_url="$(dirname "$url")"
   echo "$base_url"
else
   exit 1
fi
{'fraction_non_alphanumeric': 0.14251290877796902, 'fraction_numerical': 0.016523235800344233, 'mean_word_length': 3.330849478390462, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '484683', 'n_tokens_mistral': 987, 'n_tokens_neox': 931, 'n_words': 377}