<commit_before>#!/bin/bash

VERSTRING=$(git describe --tags --long)
OUT=$1

MAJOR=`echo $VERSTRING | cut -d'.' -f1`
MINOR=`echo $VERSTRING | cut -d'.' -f2`
REVIS=`echo $VERSTRING | cut -d'.' -f3 | cut -d'-' -f 1`
TINYBUILD=`echo $VERSTRING | cut -d'-' -f2`
RC=
if [ $(echo $TINYBUILD | grep rc) ]; then
	# We've got a release candidate. Reparse to get the build -number-.
	RC=-$TINYBUILD
	TINYBUILD=`echo $VERSTRING | cut -d'-' -f3`
fi

VERSTRING=$(git describe --tags)

rm -f $OUT.tmp

cat >> $OUT.tmp << __eof__
#ifndef __included_cc_build_number_h
#define __included_cc_build_number_h

#define CC_LIB_VERSION_MAJOR $MAJOR
#define CC_LIB_VERSION_MINOR $MINOR
#define CC_LIB_VERSION_REVISION $REVIS
#define CC_LIB_VERSION_BUILD $TINYBUILD
#define CC_LIB_VERSION "$MAJOR.$MINOR.$REVIS$RC"
#define CC_LIB_VERSION_STRING "$VERSTRING"

#define CC_RESOURCE_VERSION $MAJOR,$MINOR,$REVIS,$TINYBUILD
#define CC_RESOURCE_VERSION_STRING "$MAJOR, $MINOR, $REVIS, $TINYBUILD"

#endif

__eof__

MD5NEW=`md5sum $OUT.tmp | cut -d' ' -f1`
MD5OLD=`md5sum $OUT | cut -d' ' -f1`

if [ $MD5NEW == $MD5OLD ]; then
        echo "$OUT is already up to date."
        rm -f $OUT.tmp
else
        echo "$OUT updated."
        mv $OUT.tmp $OUT
fi
<commit_msg>gen_buildnum_h.sh: fix empty string bug<commit_after>#!/bin/bash

VERSTRING=$(git describe --tags --long)
OUT=$1

MAJOR=`echo $VERSTRING | cut -d'.' -f1`
MINOR=`echo $VERSTRING | cut -d'.' -f2`
REVIS=`echo $VERSTRING | cut -d'.' -f3 | cut -d'-' -f 1`
TINYBUILD=`echo $VERSTRING | cut -d'-' -f2`
RC=
if [ $(echo $TINYBUILD | grep rc) ]; then
	# We've got a release candidate. Reparse to get the build -number-.
	RC=-$TINYBUILD
	TINYBUILD=`echo $VERSTRING | cut -d'-' -f3`
fi

VERSTRING=$(git describe --tags)

rm -f $OUT.tmp

cat >> $OUT.tmp << __eof__
#ifndef __included_cc_build_number_h
#define __included_cc_build_number_h

#define CC_LIB_VERSION_MAJOR $MAJOR
#define CC_LIB_VERSION_MINOR $MINOR
#define CC_LIB_VERSION_REVISION $REVIS
#define CC_LIB_VERSION_BUILD $TINYBUILD
#define CC_LIB_VERSION "$MAJOR.$MINOR.$REVIS$RC"
#define CC_LIB_VERSION_STRING "$VERSTRING"

#define CC_RESOURCE_VERSION $MAJOR,$MINOR,$REVIS,$TINYBUILD
#define CC_RESOURCE_VERSION_STRING "$MAJOR, $MINOR, $REVIS, $TINYBUILD"

#endif

__eof__

MD5NEW=`md5sum $OUT.tmp | cut -d' ' -f1`
MD5OLD=`md5sum $OUT | cut -d' ' -f1`

if [ "$MD5NEW" == "$MD5OLD" ]; then
        echo "$OUT is already up to date."
        rm -f $OUT.tmp
else
        echo "$OUT updated."
        mv $OUT.tmp $OUT
fi

{'fraction_non_alphanumeric': 0.15292233787029624, 'fraction_numerical': 0.01200960768614892, 'mean_word_length': 4.1419753086419755, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4518749', 'n_tokens_mistral': 1055, 'n_tokens_neox': 1018, 'n_words': 262}