Skip to content

Instantly share code, notes, and snippets.

@dylanmckay
Created September 26, 2017 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dylanmckay/221f127db7b52cd9e168dd9abc7450e6 to your computer and use it in GitHub Desktop.
Save dylanmckay/221f127db7b52cd9e168dd9abc7450e6 to your computer and use it in GitHub Desktop.
#! /usr/bin/env ruby
# Verifies that every AVR-specific commit in Github:avr-rust/llvm has been
# upstreamed to LLVM trunk.
Commit = Struct.new(:oid, :message)
def log(arguments = [])
raw_output = `git log --oneline --no-decorate #{arguments}`
raw_output.split("\n").map(&:chomp).map do |line|
parts = line.split(' ')
oid = parts[0]
message = parts[1..-1].join(' ')
Commit.new(oid, message)
end
end
avr_rust_specific_commits = log('rust/rust-llvm-release-4-0-1..')
def upstream_llvm_master_log
@master_log ||= log('origin/master')
end
def associated_llvm_proper_commit(commit)
upstream_llvm_master_log.find { |mc| mc.message == commit.message }
end
avr_rust_specific_commits.each do |commit|
unless associated_llvm_proper_commit(commit)
$stderr.puts "commit in avr-rust fork but missing from llvm proper"
$stderr.puts "=" * 31
$stderr.puts "#{commit.oid} #{commit.message}"
$stderr.puts
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment