Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 81bfcf01ed2bbe1c1f6ae0f80b910dc657557c1a
      
https://github.com/WebKit/WebKit/commit/81bfcf01ed2bbe1c1f6ae0f80b910dc657557c1a
  Author: Sam Sneddon <gsnedd...@apple.com>
  Date:   2024-01-30 (Tue, 30 Jan 2024)

  Changed paths:
    M Tools/Scripts/webkitpy/common/checkout/diff_parser.py
    M Tools/Scripts/webkitpy/common/checkout/diff_parser_unittest.py
    M Tools/Scripts/webkitpy/common/checkout/scm/git.py
    M Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
    M Tools/Scripts/webkitpy/style/main.py

  Log Message:
  -----------
  [check-webkit-style] only check a diff from git
https://bugs.webkit.org/show_bug.cgi?id=265030

Reviewed by Jonathan Bedard.

Previously, we passed commit_message=True, which led us to get
git-format-tree output (an mbox, with patches formatted as a sequence of
emails with commit messages and a diffstat prior to the actual patch)
from Scm.create_patch, rather than the output of git-diff, which
DiffParser can actually parse.

Change the call to Scm.create_patch to ensure we only get a diff, and
not other metadata.

However, this exposed the fact that Git.create_patch didn't account for
the difference in command-line arguments between git-format-tree and
git-diff, thus we need to correctly pass the correct set of revisions we
wish to obtain a diff for, nor did it correctly pass the order file.

As a drive-by, add a test that we get an error from DiffParser given an
mbox.

Lastly, skip SCM tests that involve svn if it is not installed.

* Tools/Scripts/webkitpy/common/checkout/diff_parser.py:
(DiffParser._parse_into_diff_files):
* Tools/Scripts/webkitpy/common/checkout/diff_parser_unittest.py:
(DiffParserTest.setUp):
(DiffParserTest):
(DiffParserTest.tearDown):
(test_git_format_patch_multiple):
* Tools/Scripts/webkitpy/common/checkout/scm/git.py:
(Git.create_patch):
* Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
(SVNTest.setUp):
(GitTest.test_create_patch_merge_base_without_commit_message):
(GitTest):
(GitTest.test_create_patch_merge_base_with_commit_message):
(GitSVNTest.setUp):
* Tools/Scripts/webkitpy/style/main.py:
(CheckWebKitStyle.main):

Canonical link: https://commits.webkit.org/273780@main


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to