<commit_before>opm.stage.start() {
    STAGE+=($1)
    opm.util.requires_dir ${STAGEDIR}
    touch "$STAGEDIR/$1-pending"
    msg "starting"
}

opm.stage.complete() {
    opm.util.requires_dir ${STAGEDIR}
    if [ -f "$STAGEDIR/$1-pending" ] ; then
        mv "$STAGEDIR/$1-pending" "$STAGEDIR/$1"
    else
        touch "$STAGEDIR/$1"
    fi
    msg "completed"
    unset STAGE[${#STAGE[@]}-1]

    # Handle postmerge
    if [ "$1" == 'merge' ] ; then
        if opm.util.func_exists 'opm.postmerge'; then
            opm.postmerge
        fi
    fi
}

opm.stage.fail() {
    opm.util.requires_dir ${STAGEDIR}
    if [ -f "$STAGEDIR/$1-pending" ] ; then
        mv "$STAGEDIR/$1-pending" "$STAGEDIR/$1-failed"
    else
        touch "$STAGEDIR/$1-failed"
    fi<commit_msg>Add the ability to execute a *pre* action.<commit_after>opm.stage.start() {
    if [ "$1" == 'fetch' ] ; then
        if opm.util.func_exists 'opm.pre'; then
            opm.pre
        fi
    fi
    STAGE+=($1)
    opm.util.requires_dir ${STAGEDIR}
    touch "$STAGEDIR/$1-pending"
    msg "starting"
}

opm.stage.complete() {
    opm.util.requires_dir ${STAGEDIR}
    if [ -f "$STAGEDIR/$1-pending" ] ; then
        mv "$STAGEDIR/$1-pending" "$STAGEDIR/$1"
    else
        touch "$STAGEDIR/$1"
    fi
    msg "completed"
    unset STAGE[${#STAGE[@]}-1]

    # Handle postmerge
    if [ "$1" == 'merge' ] ; then
        if opm.util.func_exists 'opm.post'; then
            opm.post
        fi
    fi
}

opm.stage.fail() {
    opm.util.requires_dir ${STAGEDIR}
    if [ -f "$STAGEDIR/$1-pending" ] ; then
        mv "$STAGEDIR/$1-pending" "$STAGEDIR/$1-failed"
    else
        touch "$STAGEDIR/$1-failed"
    fi
{'fraction_non_alphanumeric': 0.16834617664493184, 'fraction_numerical': 0.014819205690574985, 'mean_word_length': 2.172932330827068, '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': '2841832', 'n_tokens_mistral': 680, 'n_tokens_neox': 665, 'n_words': 123}