Created
September 26, 2017 00:44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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