<commit_before>require "shellwords"

module Selinimum
  module Git
    class << self
      def change_list(sha)
        sha = recent_shas[1] if ignore_intermediate_commits?
        `git diff --name-only #{Shellwords.escape(sha)}`.split(/\n/)
      end

      def recent_shas
        `git log --oneline --first-parent --pretty=format:'%H'|head -n 100`.split(/\n/)
      end

      def head
        recent_shas.first
      end

      def normalize_sha(sha)
        sha = `git show #{Shellwords.escape(sha)} --pretty=format:'%H' --name-only 2>/dev/null|head -n 1`
        sha.strip unless sha.empty?
      end<commit_msg>spec: fix selinimum capture on workers<commit_after>require "shellwords"

module Selinimum
  module Git
    class << self
      def change_list(sha)
        sha = recent_shas[1] if ignore_intermediate_commits?
        `git diff --name-only #{Shellwords.escape(sha)}`.split(/\n/)
      end

      def recent_shas
        `git log --oneline --first-parent --pretty=format:'%H'|head -n 100`.split(/\n/)
      end

      def head
        recent_shas.first || ENV["GERRIT_PATCHSET_REVISION"] || raise("no .git directory, and no revision specified!")
      end

      def normalize_sha(sha)
        sha = `git show #{Shellwords.escape(sha)} --pretty=format:'%H' --name-only 2>/dev/null|head -n 1`
        sha.strip unless sha.empty?
      end
{'fraction_non_alphanumeric': 0.1329394387001477, 'fraction_numerical': 0.008862629246676515, 'mean_word_length': 2.4478371501272265, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3850221', 'n_tokens_mistral': 459, 'n_tokens_neox': 436, 'n_words': 108}