<commit_before>#!/usr/bin/perl

use strict;
use warnings;
use FindBin qw($Bin);

sub simple_repo {
    my $name = shift;

    my $repo = "$Bin/${name}_repo";

    # clean up
    `rm -rf $repo`;
    `rm -rf $repo.git`;

    `mkdir -p $repo/bin`;
    `echo "README.md skip\nt skip" > $repo/.dfminstall`;
    `mkdir -p $repo/t`;
    `echo "ignore" > $repo/.gitignore`;
    `echo "readme contents" > $repo/README.md`;
    `cp $Bin/../bin/dfm $repo/bin`;

    chdir($repo);
    `git init`;
    `git add .`;
    `git ci -m 'initial commit'`;
    chdir($Bin);
    `git clone --bare $repo $repo.git`;
    `rm -rf $repo`;

    return "$repo.git";
}

sub minimum_home {
    my $name = shift;
    my $origin_repo_path = shift || simple_repo($name);

    my $home = "$Bin/$name";
    my $repo = "$home/.dotfiles";

    # clear out old test area
    `rm -rf $home`;

    # create homedir
    `mkdir -p $home`;

    `git clone file://$origin_repo_path $repo`;

    return ( $home, $repo, $origin_repo_path );
}

sub minimum_home_with_ssh {
    my $name = shift;
    my $skip_home_ssh_dir = shift || 0;

    my ( $home, $repo ) = minimum_home($name);

    `mkdir -p $home/.ssh` if !$skip_home_ssh_dir;

    # create repo and copy in dfm
    `echo ".ssh" >> $repo/.dfminstall`;
    `mkdir -p $repo/.ssh`;
    `echo "sshignore" > $repo/.ssh/.gitignore`;

    return ( $home, $repo );
}

sub load_mod {
    my $module_name_and_args = shift;

    eval "use $module_name_and_args";
    return !$@;
}
1;
<commit_msg>don't use git aliases<commit_after>#!/usr/bin/perl

use strict;
use warnings;
use FindBin qw($Bin);

sub simple_repo {
    my $name = shift;

    my $repo = "$Bin/${name}_repo";

    # clean up
    `rm -rf $repo`;
    `rm -rf $repo.git`;

    `mkdir -p $repo/bin`;
    `echo "README.md skip\nt skip" > $repo/.dfminstall`;
    `mkdir -p $repo/t`;
    `echo "ignore" > $repo/.gitignore`;
    `echo "readme contents" > $repo/README.md`;
    `cp $Bin/../bin/dfm $repo/bin`;

    chdir($repo);
    `git init`;
    `git add .`;
    `git commit -m 'initial commit'`;
    chdir($Bin);
    `git clone --bare $repo $repo.git`;
    `rm -rf $repo`;

    return "$repo.git";
}

sub minimum_home {
    my $name = shift;
    my $origin_repo_path = shift || simple_repo($name);

    my $home = "$Bin/$name";
    my $repo = "$home/.dotfiles";

    # clear out old test area
    `rm -rf $home`;

    # create homedir
    `mkdir -p $home`;

    `git clone file://$origin_repo_path $repo`;

    return ( $home, $repo, $origin_repo_path );
}

sub minimum_home_with_ssh {
    my $name = shift;
    my $skip_home_ssh_dir = shift || 0;

    my ( $home, $repo ) = minimum_home($name);

    `mkdir -p $home/.ssh` if !$skip_home_ssh_dir;

    # create repo and copy in dfm
    `echo ".ssh" >> $repo/.dfminstall`;
    `mkdir -p $repo/.ssh`;
    `echo "sshignore" > $repo/.ssh/.gitignore`;

    return ( $home, $repo );
}

sub load_mod {
    my $module_name_and_args = shift;

    eval "use $module_name_and_args";
    return !$@;
}
1;

{'fraction_non_alphanumeric': 0.1788807461692205, 'fraction_numerical': 0.0013324450366422385, 'mean_word_length': 2.549645390070922, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '4570795', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1173, 'n_words': 299}