[Git][reproducible-builds/diffoscope][master] 3 commits: Don't use "Inheriting PATH of X", use "PATH is X".

Chris Lamb gitlab at salsa.debian.org
Fri Feb 26 18:25:28 UTC 2021



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
2e6ea686 by Chris Lamb at 2021-02-25T10:18:07+00:00
Don't use "Inheriting PATH of X", use "PATH is X".

- - - - -
654bfa84 by Chris Lamb at 2021-02-25T10:18:31+00:00
Correct capitalisation of jQuery.

- - - - -
ff418f11 by Chris Lamb at 2021-02-26T18:24:54+00:00
Don't call difflib.Differ.compare with very large inputs; it is at least O(n^2) and makes diffoscope (appear to) hang. (Closes: reproducible-builds/diffoscope#240)

- - - - -


3 changed files:

- diffoscope/diff.py
- diffoscope/environ.py
- diffoscope/presenters/html/html.py


Changes:

=====================================
diffoscope/diff.py
=====================================
@@ -539,6 +539,17 @@ class SideBySideDiff:
         Given two lists of lines, use python's difflib to make the diff a bit
         "smarter", as it better detects added lines (see !64)
         """
+
+        if len(l0) + len(l1) > 750:
+            # difflib.Differ.compare is at least O(n^2), so don't call it if
+            # our inputs are too large.
+            logger.debug(
+                "Not calling difflib.Differ.compare(x, y) with len(x) == %d and len(y) == %d",
+                len(l0),
+                len(l1),
+            )
+            return
+
         saved_line = None
         for line in self.differ.compare(l0, l1):
             # Skip lines with details as they don't matter to us


=====================================
diffoscope/environ.py
=====================================
@@ -30,7 +30,7 @@ def normalize_environment():
     """
 
     logger.debug(
-        "Normalising locale, timezone, etc. Inheriting PATH of %s",
+        "Normalising locale, timezone, etc. PATH is %s",
         os.environ.get("PATH", "(none)"),
     )
 


=====================================
diffoscope/presenters/html/html.py
=====================================
@@ -861,7 +861,7 @@ class HTMLPresenter(Presenter):
             if os.path.exists(path):
                 os.symlink(path, check_path)
                 logger.debug(
-                    "jquery found at %s and symlinked to %s", path, check_path
+                    "jQuery found at %s and symlinked to %s", path, check_path
                 )
                 return url.path
 



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/e9217cf5bcf78e34f562ca80b7a75f64a978285e...ff418f11d2f8828b655901e85b907514717797cb

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/e9217cf5bcf78e34f562ca80b7a75f64a978285e...ff418f11d2f8828b655901e85b907514717797cb
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20210226/ad4da6e9/attachment.htm>


More information about the rb-commits mailing list