<commit_before>#!/bin/bash

function do-apply
{
    init="$(git rev-list --max-parents=0 HEAD)"
    patches="$(git format-patch ${init}..master \
        --minimal --no-add-header --no-stat \
        --no-signature --keep-subject --zero-commit)"
    for name in $patches
    do
        commit=${name:5:-6}
        newname="$(ls ../*${commit}*.patch 2>/dev/null | head -n1)"
        if [ -z "$newname" ]
        then
            echo -n "Please define a description for $name: "
            read description
            newname="${name:0:5}$description.patch"
        else
            newname="${newname:3}"
        fi
        mv $name ${newname}
        echo ${newname}
    done
    rm ../*.patch
    mv *.patch ../
}

cd $(dirname $0)

cd build && do-apply
<commit_msg>Make the from ident always same in patches<commit_after>#!/bin/bash

function do-apply
{
    rm *.patch 2>/dev/null
    init="$(git rev-list --max-parents=0 HEAD)"
    ident="Yanbing\\ Zhao\\ \\<<EMAIL>\\>"
    patches="$(git -c format.from=Yanbing\ Zhao\ \<<EMAIL>\> \
        format-patch ${init}..master --minimal --keep-subject --zero-commit \
        --no-add-header --no-stat --no-signature)"
    if [ $? -eq 0 ]
    then
        for name in $patches
        do
            commit=${name:5:-6}
            newname="$(ls ../*${commit}*.patch 2>/dev/null | head -n1)"
            if [ -z "$newname" ]
            then
                echo -n "Please define a description for $name: "
                read description
                newname="${name:0:5}$description.patch"
            else
                newname="${newname:3}"
            fi
            mv $name ${newname}
            echo ${newname}
        done
        rm ../*.patch
        mv *.patch ../
    fi
}

cd $(dirname $0)

cd build && do-apply

{'fraction_non_alphanumeric': 0.16918767507002802, 'fraction_numerical': 0.011204481792717087, 'mean_word_length': 1.5809248554913296, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 10, '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': '6231204', 'n_tokens_mistral': 586, 'n_tokens_neox': 564, 'n_words': 144}