]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
try to determine what the sha is of the offending commit
authorAlfredo Deza <adeza@redhat.com>
Tue, 22 Dec 2015 21:30:42 +0000 (16:30 -0500)
committerAlfredo Deza <adeza@redhat.com>
Wed, 23 Dec 2015 14:41:18 +0000 (09:41 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph-pr-commits/build/build

index 8d6845087e0595a06b49fa64c86e1b62abe18a5e..c5b18af2501960a32b033b23605a640391fd9201 100644 (file)
@@ -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)