From 7c4e5fbd4608bb4b1509552fbe9d3c0bcd7c347a Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 7 Jan 2014 12:51:51 -0700 Subject: [PATCH] Fix Travis PR testing to not overwrite the "master" that Travis creates with our "upstream master", and to also ignore commits with no content (like a Merge commit - there's no need to sign off on literally nothing) Docker-DCO-1.0-Signed-off-by: Andrew Page (github: tianon) --- .travis.yml | 3 ++- hack/travis/dco.py | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b40a16d8fb..f6c83997aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,8 @@ before_script: - sudo apt-get update -qq - sudo apt-get install -qq python-yaml - git remote add upstream git://github.com/dotcloud/docker.git - - git fetch upstream +refs/heads/master:refs/remotes/upstream/master + - git fetch --append --no-tags upstream refs/heads/master:refs/remotes/upstream/master +# sometimes we have upstream master already as origin/master (PRs), but other times we don't, so let's just make sure we have a completely unambiguous way to specify "upstream master" from here out script: - hack/travis/dco.py diff --git a/hack/travis/dco.py b/hack/travis/dco.py index bca84bfe75..6a875863a1 100755 --- a/hack/travis/dco.py +++ b/hack/travis/dco.py @@ -24,6 +24,14 @@ p = re.compile(r'^{0} ([^<]+) <([^<>@]+@[^<>]+)> \(github: (\S+)\)$'.format(re.e failed_commits = 0 for commit in commits: + commit['stat'] = subprocess.check_output([ + 'git', 'log', '--format=format:', '--max-count=1', + '--name-status', commit['hash'], '--', + ]) + if commit['stat'] == '': + print 'Commit {0} has no actual changed content, skipping.'.format(commit['hash']) + continue + m = p.search(commit['message']) if not m: print 'Commit {1} does not have a properly formatted "{0}" marker.'.format(DCO, commit['hash'])