New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 606454 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Apr 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

check-webkit-style: git diff output isn't always in the expected format

Project Member Reported by w...@chromium.org, Apr 25 2016

Issue description

If you have git configured to omit path prefixes for git diff, check-webkit-style fails:

** Presubmit ERRORS **
check-webkit-style failed
  ERROR: Unexpected line change without file path declaration: '@@ -33,6 +33,7 @@'
Traceback (most recent call last):
  File "/s/c/src/third_party/WebKit/Tools/Scripts/check-webkit-style", line 48, in <module>
    sys.exit(CheckWebKitStyle().main())
  File "/s/c/src/third_party/WebKit/Tools/Scripts/webkitpy/style/main.py", line 155, in main
    patch_checker.check(patch)
  File "/s/c/src/third_party/WebKit/Tools/Scripts/webkitpy/style/patchreader.py", line 58, in check
    patch_files = DiffParser(patch_string.splitlines()).files
  File "/s/c/src/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/diff_parser.py", line 134, in __init__
    self.files = self._parse_into_diff_files(diff_input)
  File "/s/c/src/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/diff_parser.py", line 174, in _parse_into_diff_files
    current_file.add_unchanged_line(old_diff_line, new_diff_line, line[1:])
AttributeError: 'NoneType' object has no attribute 'add_unchanged_line'

diff_parser expects filenames to begin with a prefix, but the git diff command that creates the patch doesn't configure it to always have them.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 25 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/31bcae4933857b32b30c4eaf66ce99031b814a0c

commit 31bcae4933857b32b30c4eaf66ce99031b814a0c
Author: watk <watk@chromium.org>
Date: Mon Apr 25 23:24:30 2016

Git patches created by webkitpy now always have filename prefixes

Previously, git patches created by Git.create_patch were subject to the
diff.noprefix configuration setting that the user may have enabled. When
it was enabled, DiffParser was using an incorrect regex to parse the
filenames. Now, create_patch will always prefix paths with a/ and b/.

BUG= 606454 
TEST=new unittest, manual

Review URL: https://codereview.chromium.org/1918993003

Cr-Commit-Position: refs/heads/master@{#389601}

[modify] https://crrev.com/31bcae4933857b32b30c4eaf66ce99031b814a0c/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py
[modify] https://crrev.com/31bcae4933857b32b30c4eaf66ce99031b814a0c/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py

Comment 2 by w...@chromium.org, Apr 26 2016

Status: Fixed (was: Started)

Sign in to add a comment