<commit_before>#!/bin/sh

revision=$(echo '$Id$' | awk -F'M? ' '{ print $3 }')
date=$(echo '$Id$' | awk '{ print $4 }')
time=$(echo '$Id$' | awk -F'Z? ' '{ print $5 }')

year=$(echo $date | awk -F- '{ printf "%d", $1 }')
month=$(echo $date | awk -F- '{ printf "%d", $2 }')
day=$(echo $date | awk -F- '{ printf "%d", $3 }')
hour=$(echo $time | awk -F: '{ printf "%d", $1 }')
minute=$(echo $time | awk -F: '{ printf "%d", $2 }')

extra=""
if test "$1" ; then
	extra="_$1"
fi

echo "#define VERSION_EXTRA \"${extra}\""
echo "#define VERSION_REVISION ${revision}"
echo "#define VERSION_RELEASE \"svn_r${revision}_${date}_${time}${extra}\""
echo "#define VERSION_YEAR ${year}"
echo "#define VERSION_MONTH ${month}"
echo "#define VERSION_DAY ${day}"
echo "#define VERSION_HOUR ${hour}"
echo "#define VERSION_MINUTE ${minute}"<commit_msg>.version.sh calls svn info again, as $Id is not regularly updated...<commit_after>#!/bin/sh

LC_ALL=C
export LC_ALL

if test -d .svn
then
	revision=`svn info | grep "^Last Changed Rev:" | cut -f 2 -d ':' | tr -d ' '`
	year=`svn info | grep "^Last Changed Date:" | cut -f 4 -d ' ' | cut -f 1 -d '-'`
	month=`svn info | grep "^Last Changed Date:" | cut -f 4 -d ' ' | cut -f 2 -d '-'`
	day=`svn info | grep "^Last Changed Date:" | cut -f 4 -d ' ' | cut -f 3 -d '-'`
	hour=`svn info | grep "^Last Changed Date:" | cut -f 5 -d ' ' | cut -f 1 -d ':'`
	minute=`svn info | grep "^Last Changed Date:" | cut -f 5 -d ' ' | cut -f 2 -d ':'`

	date="$year-$month-$day"
	time="$hour:$minute"
else
	revision=$(echo '$Id$' | awk -F'M? ' '{ print $3 }')
	date=$(echo '$Id$' | awk '{ print $4 }')
	time=$(echo '$Id$' | awk -F'Z? ' '{ print $5 }')

	year=$(echo $date | awk -F- '{ printf "%d", $1 }')
	month=$(echo $date | awk -F- '{ printf "%d", $2 }')
	day=$(echo $date | awk -F- '{ printf "%d", $3 }')
	hour=$(echo $time | awk -F: '{ printf "%d", $1 }')
	minute=$(echo $time | awk -F: '{ printf "%d", $2 }')
fi

extra=""
if test "$1" ; then
	extra="_$1"
fi

echo "#define VERSION_EXTRA \"${extra}\""
echo "#define VERSION_REVISION ${revision}"
echo "#define VERSION_RELEASE \"svn_r${revision}_${date}_${time}${extra}\""
echo "#define VERSION_YEAR `echo ${year} | sed 's/^[0]*//g'`"
echo "#define VERSION_MONTH `echo ${month} | sed 's/^[0]*//g'`"
echo "#define VERSION_DAY `echo ${day} | sed 's/^[0]*//g'`"
echo "#define VERSION_HOUR `echo ${hour} | sed 's/^[0]*//g'`"
echo "#define VERSION_MINUTE `echo ${minute} | sed 's/^[0]*//g'`"
{'fraction_non_alphanumeric': 0.25857843137254904, 'fraction_numerical': 0.014705882352941176, 'mean_word_length': 3.8303747534516766, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2433700', 'n_tokens_mistral': 1011, 'n_tokens_neox': 984, 'n_words': 302}