<commit_before>module Git
  class ReleaseNotes
    require 'enumerator'
    include CLI
    include Commands

    def annotate!
      tags = get_tags.reverse
      
      start_tag = ask "Start at which tag?", tags[0], tags
      start_index = tags.index(start_tag)      
      end_tag = ask "End at which tag?", tags[start_index + 1] || tags[start_index], tags
      puts
      end_index = tags.index(end_tag) + 1 # include end tag
      
      start_index.upto(end_index-1) do |i|
        start = tags[i]
        finish = tags[i+1]
        log = `git log --no-merges --pretty=format:"%h  %s" #{'refs/tags/' + finish + '..' if finish}refs/tags/#{start}`.strip
        next if log.empty?
        puts "#{start}"<commit_msg>Break out range logic to be more readable<commit_after>module Git
  class ReleaseNotes
    require 'enumerator'
    include CLI
    include Commands

    def annotate!
      tags = get_tags.reverse
      
      start_tag = ask "Start at which tag?", tags[0], tags
      start_index = tags.index(start_tag)      
      end_tag = ask "End at which tag?", tags[start_index + 1] || tags[start_index], tags
      puts
      end_index = tags.index(end_tag) + 1 # include end tag
      
      start_index.upto(end_index-1) do |i|
        start = tags[i]
        finish = tags[i+1]
        range = ''
        range << "refs/tags/#{finish}.." if finish # log until end tag if there is an end tag
        range << "refs/tags/#{start}"
        log = `git log --no-merges --pretty=format:"%h  %s" #{range}`.strip
        next if log.empty?
        puts "#{start}"
{'fraction_non_alphanumeric': 0.12261753494282084, 'fraction_numerical': 0.0063532401524777635, 'mean_word_length': 2.267634854771784, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1325598', 'n_tokens_mistral': 526, 'n_tokens_neox': 505, 'n_words': 146}