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

Issue 14942012: Fix 'git cl format' (Closed)

Created:
7 years, 7 months ago by digit1
Modified:
7 years, 7 months ago
CC:
chromium-reviews, Dirk Pranke, cmp-cc_chromium.org, iannucci+depot_tools_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Visibility:
Public.

Description

Fix 'git cl format' This patch fixes the implementation as follows: 1/ Fix '--full' option to check for all changes in the current branch relative to upstream. The old code only considered currently modified files, which made little sense. 2/ Fix '--full' option to apply Chromium style too. 3/ Use a proper source file filter. The original code used ".*.cc .*.cpp .*.h" as the filter, which didn't catch anything !? 4/ Add --no-ext-diff to make it work with custom "git diff" handlers. R=agable@chromium.org, maruel@chromium.org, pliard@chromium.org BUG=NONE Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=200832

Patch Set 1 #

Total comments: 2

Patch Set 2 : Implement Marc-Antoine's recommendations #

Total comments: 4

Patch Set 3 : Better way to find base commit. #

Patch Set 4 : Use splitlines() #

Total comments: 6

Patch Set 5 : nits #

Total comments: 2

Patch Set 6 : remove trailing \ + add a space. #

Patch Set 7 : I clearly didn't understand agable@ sentence :) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -10 lines) Patch
M git_cl.py View 1 2 3 4 5 6 1 chunk +38 lines, -10 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
digit1
7 years, 7 months ago (2013-05-16 12:44:20 UTC) #1
agable
Thanks for the fixes! This LGTM. I'm not sure what's up with the source filter ...
7 years, 7 months ago (2013-05-16 17:07:29 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/digit@chromium.org/14942012/1
7 years, 7 months ago (2013-05-17 08:18:43 UTC) #3
commit-bot: I haz the power
Presubmit check for 14942012-1 failed and returned exit status 1. INFO:root:Found 1 file(s). INFO:PRESUBMIT:Running pylint ...
7 years, 7 months ago (2013-05-17 08:20:21 UTC) #4
digit1
Damn, I need an owner approval :). Added a few ones as reviewers. Thanks.
7 years, 7 months ago (2013-05-17 08:55:58 UTC) #5
M-A Ruel
https://chromiumcodereview.appspot.com/14942012/diff/1/git_cl.py File git_cl.py (right): https://chromiumcodereview.appspot.com/14942012/diff/1/git_cl.py#newcode1959 git_cl.py:1959: diff_cmd += ['--name-only'] I highly prefer append() even if ...
7 years, 7 months ago (2013-05-17 12:41:48 UTC) #6
digit1
Thanks Marc-Antoine, I've implemented your recommendations. PTAL.
7 years, 7 months ago (2013-05-17 14:09:39 UTC) #7
M-A Ruel
https://chromiumcodereview.appspot.com/14942012/diff/8001/git_cl.py File git_cl.py (right): https://chromiumcodereview.appspot.com/14942012/diff/8001/git_cl.py#newcode1969 git_cl.py:1969: upstream_commit = RunGit(['merge-base', 'HEAD', cl.GetUpstreamBranch()]) Note that cl.GetUpstreamBranch() could ...
7 years, 7 months ago (2013-05-17 14:13:59 UTC) #8
digit1
https://chromiumcodereview.appspot.com/14942012/diff/8001/git_cl.py File git_cl.py (right): https://chromiumcodereview.appspot.com/14942012/diff/8001/git_cl.py#newcode1969 git_cl.py:1969: upstream_commit = RunGit(['merge-base', 'HEAD', cl.GetUpstreamBranch()]) I see, I've updated ...
7 years, 7 months ago (2013-05-17 15:00:03 UTC) #9
M-A Ruel
https://chromiumcodereview.appspot.com/14942012/diff/7003/git_cl.py File git_cl.py (right): https://chromiumcodereview.appspot.com/14942012/diff/7003/git_cl.py#newcode1970 git_cl.py:1970: if cl: It's an object so it'll always be ...
7 years, 7 months ago (2013-05-17 15:13:03 UTC) #10
digit1
https://chromiumcodereview.appspot.com/14942012/diff/7003/git_cl.py File git_cl.py (right): https://chromiumcodereview.appspot.com/14942012/diff/7003/git_cl.py#newcode1970 git_cl.py:1970: if cl: Doh :) https://chromiumcodereview.appspot.com/14942012/diff/7003/git_cl.py#newcode1972 git_cl.py:1972: upstream_commit = upstream_commit.splitlines() ...
7 years, 7 months ago (2013-05-17 15:21:08 UTC) #11
cmp_google
lgtm -- you have my owner approval to land once you get agable and maruel's ...
7 years, 7 months ago (2013-05-17 16:30:57 UTC) #12
M-A Ruel
lgtm with nit https://chromiumcodereview.appspot.com/14942012/diff/16001/git_cl.py File git_cl.py (right): https://chromiumcodereview.appspot.com/14942012/diff/16001/git_cl.py#newcode1976 git_cl.py:1976: DieWithError('Could not find base commit for ...
7 years, 7 months ago (2013-05-17 16:36:37 UTC) #13
Do Not Use -- Aaron Gable
And make sure you add a space when you remove the \. re-LGTM. maruel, thanks ...
7 years, 7 months ago (2013-05-17 16:50:06 UTC) #14
digit1
https://chromiumcodereview.appspot.com/14942012/diff/16001/git_cl.py File git_cl.py (right): https://chromiumcodereview.appspot.com/14942012/diff/16001/git_cl.py#newcode1976 git_cl.py:1976: DieWithError('Could not find base commit for this branch.' \ ...
7 years, 7 months ago (2013-05-17 16:59:52 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/digit@chromium.org/14942012/15003
7 years, 7 months ago (2013-05-17 17:00:04 UTC) #16
commit-bot: I haz the power
Change committed as 200832
7 years, 7 months ago (2013-05-17 17:01:47 UTC) #17
M-A Ruel
On 2013/05/17 17:01:47, I haz the power (commit-bot) wrote: > Change committed as 200832 FTR, ...
7 years, 7 months ago (2013-05-17 18:32:34 UTC) #18
digit1
7 years, 7 months ago (2013-05-18 08:38:35 UTC) #19
On Fri, May 17, 2013 at 8:32 PM, <maruel@chromium.org> wrote:

> On 2013/05/17 17:01:47, I haz the power (commit-bot) wrote:
>
>> Change committed as 200832
>>
>
> FTR, since you didn't add any unit test, you'll be forever on the hook if
> any
> breakage ever happens. It's a trade off, I don't consider these
> utility|optional
> commands to necessarily require a unit test.
>
>
https://chromiumcodereview.**appspot.com/14942012/<https://chromiumcodereview...
>

Yes, I understand this fully :). I considered adding a unit test, but
frankly the Mocking framework being used is insane for this kind of thing.
Would you be ok with a standalone test (git_cl_test_format.py maybe) that
doesn't uses it?

Powered by Google App Engine
This is Rietveld 408576698