<commit_before>#!/usr/bin/env ruby
require "github_api"
require "rugged"

class Rugged::Commit
  def merge_regex
    @merge_regex ||= /Merge pull request #([0-9]+) from [^\/]+\/(\S+)\s+(.*)$/
  end

  def pr_merge?
    merge_regex.match(self.message)
  end

  def to_pr_str
    m = merge_regex.match(self.message)
    "#{m[1]} : #{m[2]} : #{m[3][0,35]}"
  end
end

class GitFern
  def repo
    @repo ||= Rugged::Repository.discover("/Users/norton/src/better-core")
  end

  def tag_by_name(tag_name)
    repo.tags.find {|tag| tag.name == tag_name }
  end

  def pr_by_number(pr_number)

  end

  def merges_between(from_tag_name, to_tag_name)

    from = tag_by_name from_tag_name
    to = tag_by_name to_tag_name

    if !(from and to)
      raise "#{from_tag_name}...#{to_tag_name} is invalid"
    end
<commit_msg>there must be a way to store the result of the match, but it's a hack<commit_after>#!/usr/bin/env ruby
require "github_api"
require "rugged"

class Rugged::Commit

  def merge_regex
    @merge_regex ||= /Merge pull request #([0-9]+) from [^\/]+\/(\S+)\s+(.*)$/
  end

  def pr_merge?
    merge_regex.match(self.message)
  end

  def to_pr_str
    "#{pr_number} | #{pr_branch_name} : #{pr_description}"
  end

  def pr_number
    pr_merge?[1]
  end

  def pr_branch_name
    pr_merge?[2]
  end

  def pr_description
    pr_merge?[3]
  end

end

class GitFern
  def repo
    @repo ||= Rugged::Repository.discover("/Users/norton/src/better-core")
  end

  def tag_by_name(tag_name)
    repo.tags.find {|tag| tag.name == tag_name }
  end

  def merges_between(from_tag_name, to_tag_name)

    from = tag_by_name from_tag_name
    to = tag_by_name to_tag_name

    if !(from and to)
      raise "#{from_tag_name}...#{to_tag_name} is invalid"
    end

{'fraction_non_alphanumeric': 0.14026121521862578, 'fraction_numerical': 0.0073821692220329355, 'mean_word_length': 3.287104622871046, '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': '2023275', 'n_tokens_mistral': 720, 'n_tokens_neox': 697, 'n_words': 154}