<commit_before>#!/bin/sh
#
# Copyright (c) <NAME>
#
test_description='Test export of commits to CVS'

. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh

if ! test_have_prereq PERL; then
	skip_all='skipping git cvsexportcommit tests, perl not available'
	test_done
fi

cvs >/dev/null 2>&1
if test $? -ne 1
then
    skip_all='skipping git cvsexportcommit tests, cvs not found'
    test_done
fi

CVSROOT=$PWD/cvsroot
CVSWORK=$PWD/cvswork
GIT_DIR=$PWD/.git
export CVSROOT CVSWORK GIT_DIR

rm -rf "$CVSROOT" "$CVSWORK"
mkdir "$CVSROOT" &&
cvs init &&
cvs -Q co -d "$CVSWORK" . &&
echo >empty &&
git add empty &&
git commit -q -a -m "Initial" 2>/dev/null ||
exit 1

check_entries () {
	# $1 == directory, $2 == expected
	grep '^/' "$1/CVS/Entries" | sort | cut -d/ -f2,3,5 >actual
	if test -z "$2"
	then
		>expected
	else
		printf '%s\n' "$2" | tr '|' '\012' >expected
	fi
	test_cmp expected actual
}
<commit_msg>t9200: let "cvs init" create the test repository<commit_after>#!/bin/sh
#
# Copyright (c) <NAME>
#
test_description='Test export of commits to CVS'

. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh

if ! test_have_prereq PERL; then
	skip_all='skipping git cvsexportcommit tests, perl not available'
	test_done
fi

cvs >/dev/null 2>&1
if test $? -ne 1
then
    skip_all='skipping git cvsexportcommit tests, cvs not found'
    test_done
fi

CVSROOT=$PWD/cvsroot
CVSWORK=$PWD/cvswork
GIT_DIR=$PWD/.git
export CVSROOT CVSWORK GIT_DIR

rm -rf "$CVSROOT" "$CVSWORK"

cvs init &&
test -d "$CVSROOT" &&
cvs -Q co -d "$CVSWORK" . &&
echo >empty &&
git add empty &&
git commit -q -a -m "Initial" 2>/dev/null ||
exit 1

check_entries () {
	# $1 == directory, $2 == expected
	grep '^/' "$1/CVS/Entries" | sort | cut -d/ -f2,3,5 >actual
	if test -z "$2"
	then
		>expected
	else
		printf '%s\n' "$2" | tr '|' '\012' >expected
	fi
	test_cmp expected actual
}

{'fraction_non_alphanumeric': 0.15614973262032086, 'fraction_numerical': 0.019251336898395723, 'mean_word_length': 3.68922305764411, 'pattern_counts': {'":': 0, '<': 5, '<?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': '100920', 'n_tokens_mistral': 800, 'n_tokens_neox': 778, 'n_words': 218}