<commit_before>module Git
   def self.has_uncommitted_changes()
      clean = system("git diff --quiet 2>/dev/null >&2")
      return !clean
   end

   # Return the development branch specified by the
   # feature.development-branch git config value
   def self.development_branch
      dev_branch = `git config feature.development-branch`.strip
      if !dev_branch || $? != 0
         $stderr.puts "No development branch specified"
         $stderr.puts "  set it with: git config feature.development-branch master"
         exit 1;
      end
      dev_branch
   end

   # Returns an array of branches that aren't merged into the specified branch
   def self.branches_not_merged_into(branch)
      self::all_branches - self::merged_branches(branch)
   end

   # Returns an array of unmerged hotfix branches
   def self.hotfix_branches(type)
      branches = if type == :unmerged
         self.branches_not_merged_into('stable')
      elsif type == :merged
         self.merged_branches('stable')
      end

      branches.select {|branch| branch.include?('hotfix-') }
   end

   # Returns an array of unmerged feature branches
   def self.feature_branches(type)
      branches = if type == :unmerged
         self.branches_not_merged_into('master')
      elsif type == :merged
         self.merged_branches('master')
      end

      branches.reject {|branch| branch.include?('hotfix-') }
   end

   # Returns an array of all branch names that have have been merged into the
   # specified branch
   def self.merged_branches(into_branch='master')
      `git branch --merged #{into_branch} -a`.
         split("\n").
         map {|branch| branch.gsub('*','').strip.sub('remotes/','')}
   end

   # Returns an array of all local branch names
   def self.all_branches()
      `git for-each-ref --sort=-committerdate --format='%(refname)' refs/heads refs/remotes`.
      split("\n").
      map {|branch| branch.sub(/refs\/\w+\//, '') }.
      uniq.
      reject {|branch| branch =~ %r{\w+/HEAD} }
   end

   # Returns the name of the currently checked out branch, or nil if detached.
   def self.current_branch()
      ref = `git symbolic-ref -q HEAD`.strip<commit_msg>Use devBranch for listing branches.<commit_after>module Git
   def self.has_uncommitted_changes()
      clean = system("git diff --quiet 2>/dev/null >&2")
      return !clean
   end

   # Return the development branch specified by the
   # feature.development-branch git config value
   def self.development_branch
      dev_branch = `git config feature.development-branch`.strip
      if !dev_branch || $? != 0
         $stderr.puts "No development branch specified"
         $stderr.puts "  set it with: git config feature.development-branch master"
         exit 1;
      end
      dev_branch
   end

   # Returns an array of branches that aren't merged into the specified branch
   def self.branches_not_merged_into(branch)
      self::all_branches - self::merged_branches(branch)
   end

   # Returns an array of unmerged hotfix branches
   def self.hotfix_branches(type)
      branches = if type == :unmerged
         self.branches_not_merged_into('stable')
      elsif type == :merged
         self.merged_branches('stable')
      end

      branches.select {|branch| branch.include?('hotfix-') }
   end

   # Returns an array of unmerged feature branches
   def self.feature_branches(type)
      devBranch = development_branch()

      branches = if type == :unmerged
         self.branches_not_merged_into(devBranch)
      elsif type == :merged
         self.merged_branches(devBranch)
      else
         raise ArgumentError, 'Must specify :merged or :unmerged in feature_branches'
      end

      branches.reject {|branch| branch.include?('hotfix-') }
   end

   # Returns an array of all branch names that have have been merged into the
   # specified branch
   def self.merged_branches(into_branch='master')
      `git branch --merged #{into_branch} -a`.
         split("\n").
         map {|branch| branch.gsub('*','').strip.sub('remotes/','')}
   end

   # Returns an array of all local branch names
   def self.all_branches()
      `git for-each-ref --sort=-committerdate --format='%(refname)' refs/heads refs/remotes`.
      split("\n").
      map {|branch| branch.sub(/refs\/\w+\//, '') }.
      uniq.
      reject {|branch| branch =~ %r{\w+/HEAD} }
   end

   # Returns the name of the currently checked out branch, or nil if detached.
   def self.current_branch()
      ref = `git symbolic-ref -q HEAD`.strip
{'fraction_non_alphanumeric': 0.11051812319323993, 'fraction_numerical': 0.00177896375361352, 'mean_word_length': 2.738985868661679, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1614098', 'n_tokens_mistral': 1382, 'n_tokens_neox': 1316, 'n_words': 391}