Add a way to do minimal diff (like git diff --minimal)

XMLWordPrintable

    • 6

      Sometimes adding commits that are adding new functionality with some duplicate code don’t display right. In particular, it shows the new lines in the wrong place. ‘git diff’ shows it the same way. ‘git diff —minimal’ is better about it and often avoids these problems.

      Example:
      https://stash.sd.apple.com/projects/COREOS/repos/astris/pull-requests/404/diff

      > git diff c3e5ffa9e5c7c3c9c033967708b58c3b27925de9...eng/PR-26272156 | wc -l
      1483
      > git diff --minimal c3e5ffa9e5c7c3c9c033967708b58c3b27925de9...eng/PR-26272156 | wc -l
      1074

      In this example, there are 400+ fewer lines to review, and it properly shows which functions are affected.

      I’m also not sure the —minimal argument documentation of ‘spend extra time’ is applicable to the full system time since in my example the —minimal is actually the same or faster overall (both are consistently around 16ms total) since git diff spends less time outputting. So while this might have a small performance hit on the diff generation, the performance gain on the page generation might actually decrease server load.

            Assignee:
            Unassigned
            Reporter:
            Corey Steele
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: