<commit_before>CommandStack = ->
  stack = []
  index = 0

  execute: (command) ->
    stack[index] = command
    command.execute()

    index += 1

  undo: ->
    if @canUndo()
      index -= 1

      command = stack[index]
      command.undo()

      return command

  redo: ->
    if @canRedo()
      command = stack[index]
      command.execute()

      index += 1
<commit_msg>Testing blasting old history in CommandStack<commit_after>CommandStack = ->
  stack = []
  index = 0

  execute: (command) ->
    stack[index] = command
    command.execute()

    # Be sure to blast obsolete redos
    stack.length = index += 1

  undo: ->
    if @canUndo()
      index -= 1

      command = stack[index]
      command.undo()

      return command

  redo: ->
    if @canRedo()
      command = stack[index]
      command.execute()

      index += 1

{'fraction_non_alphanumeric': 0.12411347517730496, 'fraction_numerical': 0.009456264775413711, 'mean_word_length': 2.025, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '739134', 'n_tokens_mistral': 285, 'n_tokens_neox': 259, 'n_words': 70}