Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Issue 15898005: presubmit: Call 'git diff' once per change instead of once per file (Closed)

Created:
7 years, 7 months ago by ncarter (slow)
Modified:
7 years, 6 months ago
Reviewers:
iannucci
CC:
chromium-reviews, Dirk Pranke, cmp-cc_chromium.org, M-A Ruel
Base URL:
https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Visibility:
Public.

Description

presubmit_support: Call git once per change, to get a diff for all files. Parse this result to generate per-file diffs, which go into a cache that's shared between the AffectedFile instances. Greatly improves presubmit performance on Blink where there may be rule violations (my test case went from 50s to 5s). BUG=236206 TEST=new test in presubmit_unittest.py; manual performance test on Mac and Windows after touching hundreds of files in webkit; testing included add/move/edit/delete on both binary and text files. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=205275

Patch Set 1 #

Patch Set 2 : Added tests & removed debugging cruft. #

Patch Set 3 : Self-review fixes. #

Patch Set 4 : Small unittest cleanup. #

Patch Set 5 : Fix unit test on Windows. #

Total comments: 18

Patch Set 6 : Fixes per iannucci@ #

Patch Set 7 : More fixes. #

Total comments: 2

Patch Set 8 : Fix language in git_cl.py #

Unified diffs Side-by-side diffs Delta from patch set Stats (+282 lines, -44 lines) Patch
M patch.py View 1 chunk +1 line, -1 line 0 comments Download
M presubmit_canned_checks.py View 3 chunks +3 lines, -2 lines 0 comments Download
M presubmit_support.py View 1 2 3 4 5 6 10 chunks +80 lines, -36 lines 0 comments Download
M tests/presubmit_unittest.py View 1 2 3 4 5 5 chunks +198 lines, -5 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
ncarter (slow)
Hi Marc-Antoine, Please review.
7 years, 6 months ago (2013-06-07 00:14:23 UTC) #1
M-A Ruel
Deferring to another depot_tools owner.
7 years, 6 months ago (2013-06-07 01:01:15 UTC) #2
iannucci
Hey Nick, thanks for looking into this :) Some comments below... in particular, what do ...
7 years, 6 months ago (2013-06-07 02:17:36 UTC) #3
ncarter (slow)
https://codereview.chromium.org/15898005/diff/10001/presubmit_support.py File presubmit_support.py (right): https://codereview.chromium.org/15898005/diff/10001/presubmit_support.py#newcode492 presubmit_support.py:492: class _DiffCache(object): On 2013/06/07 02:17:36, iannucci wrote: > Why ...
7 years, 6 months ago (2013-06-07 19:51:15 UTC) #4
iannucci
lgtm % nit https://codereview.chromium.org/15898005/diff/10001/presubmit_support.py File presubmit_support.py (right): https://codereview.chromium.org/15898005/diff/10001/presubmit_support.py#newcode492 presubmit_support.py:492: class _DiffCache(object): On 2013/06/07 19:51:15, ncarter ...
7 years, 6 months ago (2013-06-07 21:30:16 UTC) #5
ncarter (slow)
https://codereview.chromium.org/15898005/diff/22001/git_cl.py File git_cl.py (right): https://codereview.chromium.org/15898005/diff/22001/git_cl.py#newcode699 git_cl.py:699: ' git branch --set-upstream-to=trunk\n' On 2013/06/07 21:30:16, iannucci wrote: ...
7 years, 6 months ago (2013-06-10 19:28:46 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/nick@chromium.org/15898005/23006
7 years, 6 months ago (2013-06-10 19:28:58 UTC) #7
commit-bot: I haz the power
7 years, 6 months ago (2013-06-10 19:30:27 UTC) #8
Message was sent while issue was closed.
Change committed as 205275

Powered by Google App Engine
This is Rietveld 408576698