Title: [218711] trunk/Websites/bugs.webkit.org
Revision
218711
Author
clo...@igalia.com
Date
2017-06-22 12:38:39 -0700 (Thu, 22 Jun 2017)

Log Message

pretty patch doesn't show image diffs with newer versions of git
https://bugs.webkit.org/show_bug.cgi?id=173691

A new security check added in git >= 2.3.3 causes it to abort
when the tool runs "git apply" to generate the images.
Detect if git supports the flag --unsafe-paths and pass it.

Reviewed by Darin Adler.

* PrettyPatch/PrettyPatch.rb:

Modified Paths

Diff

Modified: trunk/Websites/bugs.webkit.org/ChangeLog (218710 => 218711)


--- trunk/Websites/bugs.webkit.org/ChangeLog	2017-06-22 18:56:15 UTC (rev 218710)
+++ trunk/Websites/bugs.webkit.org/ChangeLog	2017-06-22 19:38:39 UTC (rev 218711)
@@ -1,3 +1,16 @@
+2017-06-22  Carlos Alberto Lopez Perez  <clo...@igalia.com>
+
+        pretty patch doesn't show image diffs with newer versions of git
+        https://bugs.webkit.org/show_bug.cgi?id=173691
+
+        A new security check added in git >= 2.3.3 causes it to abort
+        when the tool runs "git apply" to generate the images.
+        Detect if git supports the flag --unsafe-paths and pass it.
+
+        Reviewed by Darin Adler.
+
+        * PrettyPatch/PrettyPatch.rb:
+
 2017-05-26  Devin Rousso  <drou...@apple.com>
 
         Provide bug information when https://webkit.org/b/# URLs are added in comments

Modified: trunk/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb (218710 => 218711)


--- trunk/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb	2017-06-22 18:56:15 UTC (rev 218710)
+++ trunk/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb	2017-06-22 19:38:39 UTC (rev 218711)
@@ -777,7 +777,16 @@
 
         def self.run_git_apply_on_patch(output_filepath, patch)
             # Apply the git binary patch using git-apply.
-            cmd = GIT_PATH + " apply --directory=" + File.dirname(output_filepath)
+            cmd = GIT_PATH + " apply"
+            # Check if we need to pass --unsafe-paths (git >= 2.3.3)
+            helpcmd = GIT_PATH + " help apply"
+            stdin, stdout, stderr = *Open3.popen3(helpcmd)
+            begin
+                if stdout.read().include? "--unsafe-paths"
+                    cmd += " --unsafe-paths"
+                end
+            end
+            cmd += " --directory=" + File.dirname(output_filepath)
             stdin, stdout, stderr = *Open3.popen3(cmd)
             begin
                 stdin.puts(patch)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to