<commit_before>#!/usr/bin/env perl

use v5.12;
use Cwd;
use File::Spec;

my $script= qq{#!/bin/sh
SCRIPT_LOC=\$(readlink -f \$0)
SCRIPT_PATH=`dirname \$SCRIPT_LOC`
GIT_DIR="\$SCRIPT_PATH/.."

ln -f \$GIT_DIR/../.vimrc ~/.vimrc

echo "Links created"
};

for( qw(post-commit  post-merge) ){
    my $file = ".git/hooks/$_";
    open(my $dh, ">" , $file) or die "Can't open $file for writing";
    print $dh $script;
    `chmod +x $file`;
};
say "Hooks created";
<commit_msg>better error reporing hook-create , call hook after creating<commit_after>#!/usr/bin/env perl

use v5.12;
use Cwd;
use File::Spec;

my $script= qq{#!/bin/sh
SCRIPT_LOC=\$(readlink -f \$0)
SCRIPT_PATH=`dirname \$SCRIPT_LOC`
GIT_DIR="\$SCRIPT_PATH/.."

ln -f \$GIT_DIR/../.vimrc ~/.vimrc

echo "Links created"
};

for( qw(post-commit  post-merge) ){
    my $file = ".git/hooks/$_";
    open(my $dh, ">" , $file) or die "Can't open $file for writing: $!";
    print $dh $script;
    close($dh);
    system("chmod", "+x", $file) == 0 or die "Can't change permission for $file: $?";
};
say "Hooks created";

system(".git/hooks/post-commit") ==0 or die "Can't execute post-commit hook: $?";

{'fraction_non_alphanumeric': 0.2093425605536332, 'fraction_numerical': 0.00865051903114187, 'mean_word_length': 3.6095617529880477, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7181717', 'n_tokens_mistral': 505, 'n_tokens_neox': 471, 'n_words': 122}