<commit_before>#!/bin/bash

files_changed() {
    base_parent=$(git log --pretty=%P -n 1 HEAD | cut -d" " -f1)
    git diff --name-only HEAD $base_parent
}

check_paths_of_interest() {
    paths_of_interest=$1
    paths_exist=false
    if [[ "$paths_of_interest" != "" ]]; then
        for path in ${paths_of_interest[*]}; do
            if files_changed | grep -q "^$path"; then
                paths_exist=true
                break
            fi
        done
    fi
    if [[ "$paths_exist" = "true" ]]; then
        return 0
    else
        return 1
    fi
}<commit_msg>check against master merges<commit_after>#!/bin/bash

files_changed() {
    # Narrow to the last two merges to master (this and the prior one). Then
    # get the commit prior to this one and extract the commit id.
    last_merge_to_master=$(
        git log --all --grep="Merge branch.*into master" --oneline | \
            head -2 | \
            tail -1 | \
            sed "s/ .*//")

    # Get the files changed since the last merge to master.
    git diff --name-only HEAD $last_merge_to_master
}

check_paths_of_interest() {
    paths_of_interest=$1
    paths_exist=false
    if [[ "$paths_of_interest" != "" ]]; then
        for path in ${paths_of_interest[*]}; do
            if files_changed | grep -q "^$path"; then
                paths_exist=true
                break
            fi
        done
    fi
    if [[ "$paths_exist" = "true" ]]; then
        return 0
    else
        return 1
    fi
}
{'fraction_non_alphanumeric': 0.11559139784946236, 'fraction_numerical': 0.006720430107526882, 'mean_word_length': 1.8634615384615385, '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': '6665789', 'n_tokens_mistral': 483, 'n_tokens_neox': 457, 'n_words': 140}