<commit_before><commit_msg>adding mikeys script<commit_after>#!/usr/bin/env bash
set -euo pipefail  ## README -> http://redsymbol.net/articles/unofficial-bash-strict-mode/
IFS=$'\n\t'

# Log to syslog
exec 1> >(logger -s -t $(basename $0)) 2>&1

# System Variables
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SYSTEM=${OSTYPE//[0-9.]/}
HNAME=$(hostname)
TMP='/tmp/gitclonerepo'
REPO_A="http://github.com/wilsonmar/SampleA"
REPO_B="http://github.com/wilsonmar/SampleB"

rm -Rf ${TMP}
mkdir ${TMP}


function gg ()
{
   local _gg="$1";
   shift;
   git --git-dir="${_gg}/.git" --work-tree="${_gg}" "$@"
}

git clone ${REPO_A} ${TMP}/sampleA
#gg ${TMP}/sampleA remote rm origin
( cd ${TMP}/sampleA && git filter-branch --subdirectory-filter SampleA-folder1 -- --all)
mkdir ${TMP}/samplea-tmp-directory1
mv ${TMP}/sampleA/* ${TMP}/samplea-tmp-directory1/
mv ${TMP}/.git ${TMP}/samplea-tmp-directory1/
gg ${TMP}/samplea-tmp-directory1 git checkout -b SampleA-for-branchB
gg /tmp/gitclonerepo/samplea-tmp-directory1 git push origin SampleA-for-branchB

git clone ${REPO_B} ${TMP}/sampleB
gg ${TMP}/sampleB remote add repo-A-branch ${REPO_A}
gg ${TMP}/sampleB pull repo-A-branch SampleA-for-branchB
# gg ${TMP}/sampleB remote rm repo-A-branch
{'fraction_non_alphanumeric': 0.20096463022508038, 'fraction_numerical': 0.011254019292604502, 'mean_word_length': 4.3896103896103895, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1153958', 'n_tokens_mistral': 490, 'n_tokens_neox': 485, 'n_words': 102}