From: Alfredo Deza Date: Tue, 22 Dec 2015 21:30:42 +0000 (-0500) Subject: try to determine what the sha is of the offending commit X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=db0d9fc4a78cf8e86704252406ce584bebcd51d7;p=ceph-build.git try to determine what the sha is of the offending commit Signed-off-by: Alfredo Deza --- diff --git a/ceph-pr-commits/build/build b/ceph-pr-commits/build/build index 8d684508..c5b18af2 100644 --- a/ceph-pr-commits/build/build +++ b/ceph-pr-commits/build/build @@ -20,8 +20,16 @@ returncode = process.wait() stdout = process.stdout.read() stderr = process.stderr.read() -# git log output goes to stdout so process that +def extract_sha(lines): + trim = lines.split() + for i in trim: + if i and 'commit' not in i: + return i -for chunk in stdout.split('commit '): # we are interested in every commit chunk +# git log output goes to stdout so process that +for chunk in stdout.split('\n\ncommit'): # we are interested in every commit chunk + if not chunk: + continue if not 'Signed-off-by:' in chunk: - raise SystemExit('A commit is missing "Signed-off-by"') + sha = extract_sha(chunk) + raise SystemExit('A commit is missing "Signed-off-by". sha: %s' % sha)