<commit_before>#! /bin/bash -e
# $Id$
# -----------------------------------------------------------------------------
# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-10 <NAME>
#
# CppAD is distributed under multiple licenses. This distribution is under
# the terms of the
#                     Common Public License Version 1.0.
#
# A copy of this license is included in the COPYING file of this distribution.
# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
# -----------------------------------------------------------------------------
# replacement text for this commit
cat << EOF > bin/commit.1.$$
This is a template file for making commits to the CppAD repository.
Lines with no 'at' characters, are general comments not connected to 
a specific file. Lines containing an 'at' character are "file name" 
followed by comment. Lines before the first 'at' character are preserved
during
	bin/commit.sh edit 
for example this entire paragraph is preserved.

dir/file.ext@ optional comment about this file.
EOF
# -----------------------------------------------------------------------------
if [ ! -e "bin/commit.sh" ]
then
	echo "bin/commit.sh: must be executed from its parent directory"
	rm bin/commit.1.$$
	exit 1
fi
# -----------------------------------------------------------------------
if [ "$1" != 'list' ] && [ "$1" != 'edit' ] && [ "$1" != 'run' ]
then
cat << EOF
usage: bin/commit.sh list
       bin/commit.sh edit
       bin/commit.sh run

list:
output a list of the files that have changes svn knows about.

edit:
Edit the file list of files at the top of bin/commit.sh to be the same as 
	bin/commit.sh list
would output.  In addition, it displays the changes to bin/commit.sh. This 
will include the new files in the list since the last edit of bin/commit.sh. 
You should then edit bin/commit.sh by hand, to add comments about the changes, 
(and remove bin/commit.sh from the list) before running the command
	bin/commit.sh run

run:
commits changes to the list of files in bin/commit.sh 
(provided that you reply y to the [y/n] prompt that bin/commit.sh generates).
The files bin/commit.sh and bin/commit.sed cannot be commited this way; use
	svn commit -m "your log message" bin/commit.sh bin/commit.sed
for commits to these files.
EOF
	rm bin/commit.1.$$
	exit 1
fi
# -----------------------------------------------------------------------
for file  in bin/commit.sed
do
	abort=`svn status $file`
	if [ "$abort" != "" ]
	then
		echo "svn status $file"
		svn status $file
		echo "bin/commit.sh: aborting because $file changed"
		rm bin/commit.1.$$
		exit 1
	fi
done
# -----------------------------------------------------------------------
if [ "$1" == 'list' ] || [ "$1" == 'edit' ]
then
	# -------------------------------------------------
	unknown=`svn status | sed -n \
		-e '/[/ ]junk\./d'  \
		-e '/[/]test_one.cpp/d' \
		-e '/[/]test_one.sh/d' \
		-e '/^[?].*\.am$/p'  \
		-e '/^[?].*\.cpp$/p'  \
		-e '/^[?].*\.hpp$/p'  \
		-e '/^[?].*\.in$/p'  \
		-e '/^[?].*\.omh$/p'  \
		-e '/^[?].*\.sh$/p'   | sed -e 's/^[?]//'`
	msg="aborting because the following files are unknown to svn"
	print_msg="no"
	for file in $unknown
	do
		if [ ! -e "$file.in" ]
		then
			if [ "$print_msg" == "no" ]
			then
				echo "bin/commit.sh: $msg"
				print_msg="yes"
			fi
			echo $file
		fi
	done
	if [ "$print_msg" == "yes" ]
	then
		rm bin/commit.1.$$
		exit 1
	fi
	# -------------------------------------------------
	svn status | sed -n -e '/^[ADMRC] /p' | \
		sed -e 's/^[ADMRC] [+ ]*//' \
			-e '/^bin\/commit.sh$/d' -e '/^bin\/commit.sed$/d' | \
		sort -u > bin/commit.1.$$
	# -------------------------------------------------
	if [ "$1" == 'list' ]
	then
		cat bin/commit.1.$$
		rm bin/commit.1.$$
		exit 0
	fi
	# -------------------------------------------------
	abort="no"
	list=`cat bin/commit.1.$$`
	for file in $list
	do
		# exclude */makefile.in from edits in bin/commit.sed
		local_file=`echo $file | sed -e 's|.*/||'`
		if [ -f "$file" ] && [ "$local_file" != "makefile.in" ]
		then
			sed -f bin/commit.sed $file > bin/commit.2.$$
			if ! diff $file bin/commit.2.$$ > /dev/null
			then
				echo "---------------------------------------"
				echo "bin/commit.sh: automatic changes to $file:"
				if diff $file bin/commit.2.$$
				then
					echo "bin/commit.sh: program error"
					rm bin/commit.2.$$
					rm bin/commit.1.$$
					exit 1
				fi
				abort="yes"
				if [ -x $file ]
				then<commit_msg>exclude Microsoft project files from automatic edits<commit_after>#! /bin/bash -e
# $Id$
# -----------------------------------------------------------------------------
# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-10 <NAME>
#
# CppAD is distributed under multiple licenses. This distribution is under
# the terms of the
#                     Common Public License Version 1.0.
#
# A copy of this license is included in the COPYING file of this distribution.
# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
# -----------------------------------------------------------------------------
# replacement text for this commit
cat << EOF > bin/commit.1.$$
This is a template file for making commits to the CppAD repository.
Lines with no 'at' characters, are general comments not connected to 
a specific file. Lines containing an 'at' character are "file name" 
followed by comment. Lines before the first 'at' character are preserved
during
	bin/commit.sh edit 
for example this entire paragraph is preserved.

dir/file.ext@ optional comment about this file.
EOF
# -----------------------------------------------------------------------------
if [ ! -e "bin/commit.sh" ]
then
	echo "bin/commit.sh: must be executed from its parent directory"
	rm bin/commit.1.$$
	exit 1
fi
# -----------------------------------------------------------------------
if [ "$1" != 'list' ] && [ "$1" != 'edit' ] && [ "$1" != 'run' ]
then
cat << EOF
usage: bin/commit.sh list
       bin/commit.sh edit
       bin/commit.sh run

list:
output a list of the files that have changes svn knows about.

edit:
Edit the file list of files at the top of bin/commit.sh to be the same as 
	bin/commit.sh list
would output.  In addition, it displays the changes to bin/commit.sh. This 
will include the new files in the list since the last edit of bin/commit.sh. 
You should then edit bin/commit.sh by hand, to add comments about the changes, 
(and remove bin/commit.sh from the list) before running the command
	bin/commit.sh run

run:
commits changes to the list of files in bin/commit.sh 
(provided that you reply y to the [y/n] prompt that bin/commit.sh generates).
The files bin/commit.sh and bin/commit.sed cannot be commited this way; use
	svn commit -m "your log message" bin/commit.sh bin/commit.sed
for commits to these files.
EOF
	rm bin/commit.1.$$
	exit 1
fi
# -----------------------------------------------------------------------
for file  in bin/commit.sed
do
	abort=`svn status $file`
	if [ "$abort" != "" ]
	then
		echo "svn status $file"
		svn status $file
		echo "bin/commit.sh: aborting because $file changed"
		rm bin/commit.1.$$
		exit 1
	fi
done
# -----------------------------------------------------------------------
if [ "$1" == 'list' ] || [ "$1" == 'edit' ]
then
	# -------------------------------------------------
	unknown=`svn status | sed -n \
		-e '/[/ ]junk\./d'  \
		-e '/[/]test_one.cpp/d' \
		-e '/[/]test_one.sh/d' \
		-e '/^[?].*\.am$/p'  \
		-e '/^[?].*\.cpp$/p'  \
		-e '/^[?].*\.hpp$/p'  \
		-e '/^[?].*\.in$/p'  \
		-e '/^[?].*\.omh$/p'  \
		-e '/^[?].*\.sh$/p'   | sed -e 's/^[?]//'`
	msg="aborting because the following files are unknown to svn"
	print_msg="no"
	for file in $unknown
	do
		if [ ! -e "$file.in" ]
		then
			if [ "$print_msg" == "no" ]
			then
				echo "bin/commit.sh: $msg"
				print_msg="yes"
			fi
			echo $file
		fi
	done
	if [ "$print_msg" == "yes" ]
	then
		rm bin/commit.1.$$
		exit 1
	fi
	# -------------------------------------------------
	svn status | sed -n -e '/^[ADMRC] /p' | \
		sed -e 's/^[ADMRC] [+ ]*//' \
			-e '/^bin\/commit.sh$/d' -e '/^bin\/commit.sed$/d' | \
		sort -u > bin/commit.1.$$
	# -------------------------------------------------
	if [ "$1" == 'list' ]
	then
		cat bin/commit.1.$$
		rm bin/commit.1.$$
		exit 0
	fi
	# -------------------------------------------------
	abort="no"
	list=`cat bin/commit.1.$$`
	for file in $list
	do
		# exclude */makefile.in and *.vcproj files
		# from edits in bin/commit.sed
		local_file=`echo $file | sed -e 's|.*/||'`
		file_ext=`echo $file | sed -e 's|.*\.||'`
		if [ -f "$file" ] &&  \
		   [ "$local_file" != "makefile.in" ] && \
		   [ "$file_ext" != "vcproj" ]
		then
			sed -f bin/commit.sed $file > bin/commit.2.$$
			if ! diff $file bin/commit.2.$$ > /dev/null
			then
				echo "---------------------------------------"
				echo "bin/commit.sh: automatic changes to $file:"
				if diff $file bin/commit.2.$$
				then
					echo "bin/commit.sh: program error"
					rm bin/commit.2.$$
					rm bin/commit.1.$$
					exit 1
				fi
				abort="yes"
				if [ -x $file ]
				then
{'fraction_non_alphanumeric': 0.28648470173893903, 'fraction_numerical': 0.007484041382346467, 'mean_word_length': 1.5940622323722524, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '2073182', 'n_tokens_mistral': 3173, 'n_tokens_neox': 2870, 'n_words': 989}