<commit_before># A bit of ruby comments

oldrev, newrev, refname = gets.split

# I made this banner using the unix `banner` command
puts %Q{


       #    #    ##     #####  ######  #####
       #    #   #  #      #    #       #    #
       #    #  #    #     #    #####   #    #
       # ## #  ######     #    #       #####
       ##  ##  #    #     #    #       #   #
       #    #  #    #     #    ######  #    #


}

if refname.split("/").last != "master"
  puts "You did not push to master, so water doesn't process your commits"
  exit 0
end

commits = `git rev-list #{oldrev}..#{newrev}`.split("\n")
$command = nil
$submit_hash = nil
commits.each { |commit_hash|
  msg = `git show --format=format:"%s" #{commit_hash}`.split("\n").first
  p msg
  matches = msg.match(/#(submit|update)/) || []
  $command = matches[0]
  $submit_hash = commit_hash if $command
  break if $command
}

unless $submit_hash<commit_msg>Also parse commit body for #submit tags in hooks<commit_after># A bit of ruby comments

oldrev, newrev, refname = gets.split

# I made this banner using the unix `banner` command
puts %Q{


       #    #    ##     #####  ######  #####
       #    #   #  #      #    #       #    #
       #    #  #    #     #    #####   #    #
       # ## #  ######     #    #       #####
       ##  ##  #    #     #    #       #   #
       #    #  #    #     #    ######  #    #


}

if refname.split("/").last != "master"
  puts "You did not push to master, so water doesn't process your commits"
  exit 0
end

commits = `git rev-list #{oldrev}..#{newrev}`.split("\n")
$command = nil
$submit_hash = nil
commits.each { |commit_hash|
  msg = `git show -s --format=format:'%s %b' #{commit_hash}`
  matches = msg.match(/#(submit|update)/) || []
  $command = matches[0]
  $submit_hash = commit_hash if $command
  break if $command
}

unless $submit_hash
{'fraction_non_alphanumeric': 0.1912479740680713, 'fraction_numerical': 0.0021609940572663426, 'mean_word_length': 1.8713178294573642, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6243464', 'n_tokens_mistral': 657, 'n_tokens_neox': 642, 'n_words': 147}