<commit_before>#!/bin/sh
#
# Copyright (c) 2009 <NAME>, <NAME>
#

test_description='git svn authors prog tests'

. ./lib-git-svn.sh

write_script svn-authors-prog "$PERL_PATH" <<-\EOF
	$_ = shift;
	if (s/-sub$//)  {
		print "$_ <<EMAIL>>\n";
	} else {
		print "$_ <<EMAIL>>\n";
	}
EOF

test_expect_success 'svn-authors setup' '
	cat >svn-authors <<-\EOF
	ff = FFFFFFF FFFFFFF <<EMAIL>>
	EOF
'

test_expect_success 'setup svnrepo' '
	for i in aa bb cc-sub dd-sub ee-foo ff
	do
		svn mkdir -m $i --username $i "$svnrepo"/$i
	done
'

test_expect_success 'import authors with prog and file' '
	git svn clone --authors-prog=./svn-authors-prog \
	    --authors-file=svn-authors "$svnrepo" x
'

test_expect_success 'imported 6 revisions successfully' '
	(
		cd x
		test "`git rev-list refs/remotes/git-svn | wc -l`" -eq 6
	)
'

test_expect_success 'authors-prog ran correctly' '
	(
		cd x
		git rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \
		  grep "^author ee-foo <<EMAIL>> " &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn~2 | \
		  grep "^author dd <<EMAIL>> " &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn~3 | \
		  grep "^author cc <<EMAIL>> " &&<commit_msg>t9138-git-svn-authors-prog.sh: use the $( ... ) construct for command substitution<commit_after>#!/bin/sh
#
# Copyright (c) 2009 <NAME>, <NAME>
#

test_description='git svn authors prog tests'

. ./lib-git-svn.sh

write_script svn-authors-prog "$PERL_PATH" <<-\EOF
	$_ = shift;
	if (s/-sub$//)  {
		print "$_ <<EMAIL>>\n";
	} else {
		print "$_ <<EMAIL>>\n";
	}
EOF

test_expect_success 'svn-authors setup' '
	cat >svn-authors <<-\EOF
	ff = FFFFFFF FFFFFFF <<EMAIL>>
	EOF
'

test_expect_success 'setup svnrepo' '
	for i in aa bb cc-sub dd-sub ee-foo ff
	do
		svn mkdir -m $i --username $i "$svnrepo"/$i
	done
'

test_expect_success 'import authors with prog and file' '
	git svn clone --authors-prog=./svn-authors-prog \
	    --authors-file=svn-authors "$svnrepo" x
'

test_expect_success 'imported 6 revisions successfully' '
	(
		cd x
		test "$(git rev-list refs/remotes/git-svn | wc -l)" -eq 6
	)
'

test_expect_success 'authors-prog ran correctly' '
	(
		cd x
		git rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \
		  grep "^author ee-foo <<EMAIL>> " &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn~2 | \
		  grep "^author dd <<EMAIL>> " &&
		git rev-list -1 --pretty=raw refs/remotes/git-svn~3 | \
		  grep "^author cc <<EMAIL>> " &&
{'fraction_non_alphanumeric': 0.17339373970345964, 'fraction_numerical': 0.011532125205930808, 'mean_word_length': 3.089225589225589, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '5373019', 'n_tokens_mistral': 1100, 'n_tokens_neox': 990, 'n_words': 244}