<commit_before>description 'Git repository backend'
require     'gitrb'

raise 'Newest gitrb version 0.2.7 is required. Please upgrade!' if !Gitrb.const_defined?('VERSION') || Gitrb::VERSION != '0.2.7'

class GitRepository < Repository
  CONTENT_EXT   = '.content'
  ATTRIBUTE_EXT = '.attributes'

  def initialize(config)
    logger = Plugin.current.logger
    logger.info "Opening git repository: #{config[:path]}"
    @shared_git = Gitrb::Repository.new(:path => config[:path], :create => true,
                                        :bare => config[:bare], :logger => logger)
    @git = {}
  end

  # Access the underlying gitrb repository instance
  def git
    @git[Thread.current.object_id] ||= @shared_git.dup
  end<commit_msg>require gitrb 0.2.8<commit_after>description 'Git repository backend'
require     'gitrb'

raise 'Newest gitrb version 0.2.8 is required. Please upgrade!' if !Gitrb.const_defined?('VERSION') || Gitrb::VERSION != '0.2.8'

class GitRepository < Repository
  CONTENT_EXT   = '.content'
  ATTRIBUTE_EXT = '.attributes'

  def initialize(config)
    logger = Plugin.current.logger
    logger.info "Opening git repository: #{config[:path]}"
    @shared_git = Gitrb::Repository.new(:path => config[:path], :create => true,
                                        :bare => config[:bare], :logger => logger)
    @git = {}
  end

  # Access the underlying gitrb repository instance
  def git
    @git[Thread.current.object_id] ||= @shared_git.dup
  end
{'fraction_non_alphanumeric': 0.13261163734776726, 'fraction_numerical': 0.010148849797023005, 'mean_word_length': 3.2869565217391306, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2631710', 'n_tokens_mistral': 457, 'n_tokens_neox': 435, 'n_words': 115}