RESOLVED FIXED 186810
[style] Fix --git-index option for check-webkit-style command
https://bugs.webkit.org/show_bug.cgi?id=186810
Summary [style] Fix --git-index option for check-webkit-style command
Basuke Suzuki
Reported 2018-06-19 11:53:58 PDT
It doesn't work well if master is out of sync with origin/master.
Attachments
FIX (1.54 KB, patch)
2018-06-19 12:40 PDT, Basuke Suzuki
no flags
Add unittest (3.03 KB, patch)
2018-06-21 13:55 PDT, Basuke Suzuki
dbates: review+
ews-watchlist: commit-queue-
Archive of layout-test-results from ews206 for win-future (12.75 MB, application/zip)
2018-06-21 16:26 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews126 for ios-simulator-wk2 (8.46 MB, application/zip)
2018-06-21 18:08 PDT, EWS Watchlist
no flags
fix (4.04 KB, patch)
2018-06-22 13:33 PDT, Basuke Suzuki
no flags
Basuke Suzuki
Comment 1 2018-06-19 12:40:08 PDT
Jonathan Bedard
Comment 2 2018-06-19 14:24:44 PDT
Is it possible to write unit tests for this? We have scm unit tests in webkitpy/common/checkout/scm/scm_unittest.py. These tests actually instantiate repositories locally, they're slow, but this seems like the kind of weird edge case that warrants tests.
Basuke Suzuki
Comment 3 2018-06-19 14:52:24 PDT
Oh, yea. I'll try.
Basuke Suzuki
Comment 4 2018-06-21 13:55:20 PDT
Created attachment 343273 [details] Add unittest
Basuke Suzuki
Comment 5 2018-06-21 13:55:52 PDT
$ python Tools/Scripts/test-webkitpy webkitpy.common.checkout.scm.scm_unittest.GitTest
Jonathan Bedard
Comment 6 2018-06-21 15:01:58 PDT
Confirmed these tests locally, the last question: should this be the behavior? If I'm understanding this correctly, this change means that if I have a local commit and have added, but not committed, additional changes, both the local commit and uncommitted files would be included. I use svn, so I'm probably not the right person to make this call.
Basuke Suzuki
Comment 7 2018-06-21 15:14:05 PDT
Git is different from svn that git has an indexed state, which is intermediate state between uncommitted and committed. It exists only one for a repository. So if the command line argument says "please compare with index", that means scan staged files only. Here is the document of this option. > --git-index Scan staged files only It says stated files only. (Staged file means the files in index state). And this option to create_patch() method only passed from check-webkit-style script.
EWS Watchlist
Comment 8 2018-06-21 16:25:51 PDT
Comment on attachment 343273 [details] Add unittest Attachment 343273 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/8282659 New failing tests: http/tests/security/canvas-remote-read-remote-video-localhost.html
EWS Watchlist
Comment 9 2018-06-21 16:26:03 PDT
Created attachment 343287 [details] Archive of layout-test-results from ews206 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews206 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
EWS Watchlist
Comment 10 2018-06-21 18:07:59 PDT
Comment on attachment 343273 [details] Add unittest Attachment 343273 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/8283656 New failing tests: imported/w3c/web-platform-tests/workers/semantics/structured-clone/dedicated.html
EWS Watchlist
Comment 11 2018-06-21 18:08:01 PDT
Created attachment 343300 [details] Archive of layout-test-results from ews126 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews126 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.4
Daniel Bates
Comment 12 2018-06-22 08:27:16 PDT
Comment on attachment 343273 [details] Add unittest View in context: https://bugs.webkit.org/attachment.cgi?id=343273&action=review > Tools/Scripts/webkitpy/common/checkout/scm/git.py:341 > + command = [self.executable_name, 'diff', '--binary', '--no-color', "--no-ext-diff", "--full-index", "--no-renames", order] We should take this opportunity to fix the style in this lien and make all literals single quoted.
Basuke Suzuki
Comment 13 2018-06-22 12:17:13 PDT
(In reply to Daniel Bates from comment #12) > Comment on attachment 343273 [details] > Add unittest > > View in context: > https://bugs.webkit.org/attachment.cgi?id=343273&action=review > > > Tools/Scripts/webkitpy/common/checkout/scm/git.py:341 > > + command = [self.executable_name, 'diff', '--binary', '--no-color', "--no-ext-diff", "--full-index", "--no-renames", order] > > We should take this opportunity to fix the style in this lien and make all > literals single quoted. Sure I do. For the reference, where can I find those Python coding style guideline? Thanks for r+.
Basuke Suzuki
Comment 14 2018-06-22 13:33:11 PDT
WebKit Commit Bot
Comment 15 2018-06-22 13:50:52 PDT
Comment on attachment 343360 [details] fix Clearing flags on attachment: 343360 Committed r233097: <https://trac.webkit.org/changeset/233097>
WebKit Commit Bot
Comment 16 2018-06-22 13:50:54 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 17 2018-06-22 13:52:31 PDT
Michael Catanzaro
Comment 18 2018-06-22 14:48:54 PDT
(In reply to Basuke Suzuki from comment #13) > Sure I do. For the reference, where can I find those Python coding style > guideline? I'm not sure if it's written down anywhere, but it is PEP 8 minus the line length limit.
Daniel Bates
Comment 19 2018-06-26 19:54:27 PDT
(In reply to Michael Catanzaro from comment #18) > (In reply to Basuke Suzuki from comment #13) > > Sure I do. For the reference, where can I find those Python coding style > > guideline? > > I'm not sure if it's written down anywhere, but it is PEP 8 minus the line > length limit. The PEP 8 requirement is written down at <https://webkit.org/code-style-guidelines/#python>. We should amend the guidelines to add a remark that we do not respect the line length limit. See the discussion on bug #179387.
Note You need to log in before you can comment on or make changes to this bug.