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

Issue 14629012: Adding 'git cl format' command for clang-format. (Closed)

Created:
7 years, 7 months ago by agable
Modified:
7 years, 7 months ago
CC:
chromium-reviews, Dirk Pranke, cmp-cc_chromium.org, M-A Ruel, iannucci+depot_tools_chromium.org, Greg Spencer (Chromium), darin (slow to review), cjhopman, Torne
Visibility:
Public.

Description

Adding 'git cl format' command for clang-format. As per the discussion in https://groups.google.com/a/chromium.org/forum/?fromgroups=#!topic/chromium-dev/Hl2QPNQ9E5o, this CL adds a 'git cl format' command. Users may use it at their own discretion. By default, it generates a diff against the local tracking (upstream) branch and runs clang-format-diff on that diff. When given the '--full' flag, it instead identifies all .cc, .cpp, and .h files in the diff and runs clang-format on the entirety of each of those files. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=198477

Patch Set 1 #

Total comments: 6

Patch Set 2 : Comments. #

Total comments: 4

Patch Set 3 : Nits #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -0 lines) Patch
M git_cl.py View 1 2 1 chunk +30 lines, -0 lines 1 comment Download

Messages

Total messages: 9 (0 generated)
agable
maruel@: I haven't edited git_cl.py before, so please make sure this new command is done ...
7 years, 7 months ago (2013-05-02 17:42:32 UTC) #1
Greg Spencer (Chromium)
Thanks for adding this. https://codereview.chromium.org/14629012/diff/1/git_cl.py File git_cl.py (right): https://codereview.chromium.org/14629012/diff/1/git_cl.py#newcode1928 git_cl.py:1928: parser.add_option('--full', action='store_true', default=False) It might ...
7 years, 7 months ago (2013-05-02 18:20:11 UTC) #2
M-A Ruel
https://codereview.chromium.org/14629012/diff/1/git_cl.py File git_cl.py (right): https://codereview.chromium.org/14629012/diff/1/git_cl.py#newcode1928 git_cl.py:1928: parser.add_option('--full', action='store_true', default=False) On 2013/05/02 18:20:11, Greg Spencer (Chromium) ...
7 years, 7 months ago (2013-05-02 20:38:43 UTC) #3
agable
https://codereview.chromium.org/14629012/diff/1/git_cl.py File git_cl.py (right): https://codereview.chromium.org/14629012/diff/1/git_cl.py#newcode1928 git_cl.py:1928: parser.add_option('--full', action='store_true', default=False) On 2013/05/02 20:38:43, Marc-Antoine Ruel wrote: ...
7 years, 7 months ago (2013-05-02 20:50:17 UTC) #4
M-A Ruel
lgtm with nits https://codereview.chromium.org/14629012/diff/5001/git_cl.py File git_cl.py (right): https://codereview.chromium.org/14629012/diff/5001/git_cl.py#newcode1941 git_cl.py:1941: RunCommand(cmd) RunCommand(['clang-format', '-i'] + files) https://codereview.chromium.org/14629012/diff/5001/git_cl.py#newcode1943 ...
7 years, 7 months ago (2013-05-03 01:55:56 UTC) #5
agable
https://codereview.chromium.org/14629012/diff/5001/git_cl.py File git_cl.py (right): https://codereview.chromium.org/14629012/diff/5001/git_cl.py#newcode1941 git_cl.py:1941: RunCommand(cmd) On 2013/05/03 01:55:56, Marc-Antoine Ruel wrote: > RunCommand(['clang-format', ...
7 years, 7 months ago (2013-05-06 17:41:31 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/agable@chromium.org/14629012/10001
7 years, 7 months ago (2013-05-06 17:41:43 UTC) #7
commit-bot: I haz the power
Change committed as 198477
7 years, 7 months ago (2013-05-06 17:43:10 UTC) #8
Jiang
7 years, 7 months ago (2013-05-06 19:27:31 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/14629012/diff/10001/git_cl.py
File git_cl.py (right):

https://codereview.chromium.org/14629012/diff/10001/git_cl.py#newcode1957
git_cl.py:1957: cmd = [sys.executable,
'/usr/lib/clang-format/clang-format-diff.py',
Why don't you use cfd_path here?

Powered by Google App Engine
This is Rietveld 408576698