Title: [281368] trunk/Tools
Revision
281368
Author
[email protected]
Date
2021-08-21 00:56:13 -0700 (Sat, 21 Aug 2021)

Log Message

[GLIB] Do not assume log success in apply-build-revision-to-files
https://bugs.webkit.org/show_bug.cgi?id=229335

Patch by Daniel Kolesa <[email protected]> on 2021-08-21
Reviewed by Philippe Normand.

If the origin reference does not exist for any reason, this will
fail the build. Since we have no reference point, just assume
unknown like if it wasn't a git repo.

* glib/apply-build-revision-to-files.py:
(get_build_revision):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (281367 => 281368)


--- trunk/Tools/ChangeLog	2021-08-21 07:01:21 UTC (rev 281367)
+++ trunk/Tools/ChangeLog	2021-08-21 07:56:13 UTC (rev 281368)
@@ -1,3 +1,17 @@
+2021-08-21  Daniel Kolesa  <[email protected]>
+
+        [GLIB] Do not assume log success in apply-build-revision-to-files
+        https://bugs.webkit.org/show_bug.cgi?id=229335
+
+        Reviewed by Philippe Normand.
+
+        If the origin reference does not exist for any reason, this will
+        fail the build. Since we have no reference point, just assume
+        unknown like if it wasn't a git repo.
+
+        * glib/apply-build-revision-to-files.py:
+        (get_build_revision):
+
 2021-08-20  Jonathan Bedard  <[email protected]>
 
         [git-webkit] Add pull-request command (Part 2)

Modified: trunk/Tools/glib/apply-build-revision-to-files.py (281367 => 281368)


--- trunk/Tools/glib/apply-build-revision-to-files.py	2021-08-21 07:01:21 UTC (rev 281367)
+++ trunk/Tools/glib/apply-build-revision-to-files.py	2021-08-21 07:56:13 UTC (rev 281368)
@@ -37,7 +37,13 @@
                     revision = "r%s" % contents.decode('utf-8').strip()
                     break
         elif os.path.isdir('.git'):
-            commit_message = subprocess.check_output(("git", "log", "-1", "--pretty=%B", "origin/HEAD"), stderr=devnull)
+            try:
+                commit_message = subprocess.check_output(("git", "log", "-1", "--pretty=%B", "origin/HEAD"), stderr=devnull)
+            except subprocess.CalledProcessError:
+                # This may happen with shallow checkouts whose HEAD has been
+                # modified; there is no origin reference anymore, and git
+                # will fail - let's pretend that this is not a repo at all
+                commit_message = ""
             # Commit messages tend to be huge and the metadata we're looking
             # for is at the very end. Also a spoofed 'Canonical link' mention
             # could appear early on. So make sure we get the right metadata by
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to