Commit a185e2e3c8 removed the Rietveld code review
implementation, albeit hasn't expunged all references to Rietveld. This leads
to an assertion error when running |git cl format| on a non-Gerrit change.
There appears to have been a recent attempt to articulate this error better in
a185e2e3c8, albeit not fix the underlying issue.
This change addresses the immediate issue by defaulting the code review
implementation to Gerrit rather than Reitveld.
R=joenotcharles@google.com, tandrii@chromium.org
Bug: 914150
Change-Id: I64d33e5a172cc43339ec417f7f0a7820e0337772
Reviewed-on: https://chromium-review.googlesource.com/c/1372928
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Bryce Thomas <bryct@amazon.com>
Adding the diff.noprefix flag to .gitconfig broke python
formatting because git diffs were being parsed with regex
that relied on the default git diff prefixs.
This CL fix's this issue by always specifying prefix flags
for git diffs when formatting python.
Bug:846432
Change-Id: Ifde305da9574e6b46455a0237703b7364fac77e4
Reviewed-on: https://chromium-review.googlesource.com/c/1349809
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Commit-Queue: Marc-Antoine Ruel <maruel@chromium.org>
On my machine, saves 0.16s of time while loading git cl:
from 0.32s to 0.16s.
R=ajp, ehmaldonado
Change-Id: I0febca43f11514da3e3f7be7e2c0184fb9e17409
Reviewed-on: https://chromium-review.googlesource.com/c/1344641
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Enables python formatting in git cl format by default
for all files that have a .style.yapf file in a parent
directory up to the repository root. If no .style.yapf
file is found the --python flag still needs to be
set explicitly for python formatting to be enabled.
Also adds a --no-python to explicitly disable python
formatting on any file even if a .style.yapf file is found.
This allows default formatting to be enabled on a per
project/directory basis by adding a .style.yapf file.
Bug:846432
Change-Id: I40d899ec1a3e0dfca445e04b91befab113416175
Reviewed-on: https://chromium-review.googlesource.com/c/1316415
Commit-Queue: Aiden Benner <abenner@google.com>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
git cl format --python currently breaks on windows
because FindExecutable('yapf') returns .../depot_tools/yapf
(a py file) instead of .../depot_tools/yapf.bat. Also
yapf.bat tries to run the yapf py file without vpython
which breaks the yapf dependency.
This CL fixes these two issues.
Bug:846432
Change-Id: I551a4c1e6367074fa76767851bd34feb2dcfb6a2
Reviewed-on: https://chromium-review.googlesource.com/c/1341236
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Aiden Benner <abenner@google.com>
Currently git cl owners tries to fetch the current reviewers of a CL
from gerrit. However, this fails with a KeyError when there are no
reviewers currently. This cl fixes that bug.
Bug: 895722
Change-Id: I78a998ee234d207523aa2cef4b5058ba7cfecbc2
Reviewed-on: https://chromium-review.googlesource.com/c/1330122
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Except when TBR is active, because it's not clear how to
compute max score for Code-Review label before uploading a change.
Tested with this very own CL:
To https://chromium.googlesource.com/chromium/tools/depot_tools.git
* [new branch] c78de165c7 ->
refs/for/refs/heads/master%ready,notify=ALL,m=Initial_upload,r=ehmaldonado,
cc=ajp,cc=chromium-reviews@chromium.org,cc=iannucci+depot_tools@chromium.org,
l=Commit-Queue+1,hashtag=git-cl-upload
R=ehmaldonado
Bug: 877717
Change-Id: I464d9df2814bd830dd608bb881040e2dd3c41dbb
Reviewed-on: https://chromium-review.googlesource.com/c/1307052
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
For other hosts, behavior is not changed.
Tested on this very CL:
To https://chromium.googlesource.com/chromium/tools/depot_tools.git
* [new branch] 9057c2235b ->
refs/for/refs/heads/master%ready,notify=ALL,m=Initial_upload,r=ehmaldonado,cc=chromium-reviews@chromium.org,cc=iannucci+depot_tools@chromium.org,hashtag=git-cl-upload
R=ehmaldonado
Bug: 877717
Change-Id: I951fc576105211590c6c303ce0ed2fe142628224
Reviewed-on: https://chromium-review.googlesource.com/c/1307051
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
It is not recorded by the server, but causes a 500 status anyway.
Bug: 896868
Change-Id: Ic3bf0d989bf3c3641dae9ea49a58ffb28f52e865
Reviewed-on: https://chromium-review.googlesource.com/c/1289769
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Also fix a typo in ValidateEmail function which didn't support
email addresses with '-' in them, e.g., infra-dev@chromium.org.
R=ehmaldonado
Bug: 875089
Change-Id: I2d73c1473527c9bf62e25e9f88250196b783fcb0
Reviewed-on: https://chromium-review.googlesource.com/c/1242849
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Also deletes lots of tests which provided coverage for Rietveld only,
and hence no longer useful.
R=ehmaldonado
Bug: 770408
Change-Id: I31195f7819a52d1063ed28064a74fd70fbc39357
Reviewed-on: https://chromium-review.googlesource.com/c/1279133
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
This adds O(reviewers+cc) RPC to Gerrit before upload,
though done concurrently in up to 10 threads. This information isn't
used yet, but will be in follow up CLs.
R=ehmaldonado
Bug: 877717
Change-Id: I2374f249ee874a71089244309e50e8e88a3dee7d
Reviewed-on: https://chromium-review.googlesource.com/c/1242847
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Print the message asking the user to upload gerrit logs for git-cl upload
failures after the exception.
Also, initialize the error logger only for git-cl upload, so that the
headers are not overwritten unless git-cl upload is executed again.
Bug: 881860
Change-Id: I8e63432eecca5253e56096e3ad0218eec4058e12
Reviewed-on: https://chromium-review.googlesource.com/c/1277426
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
And ask the user to report the printed headers to the bug.
Bug: 881860
Change-Id: I0a6cc0d90b4a721f72cd7eee4cba59934facbb1e
Reviewed-on: https://chromium-review.googlesource.com/c/1266837
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
This CL basically replaces "skip if is_gce" with "skip if default auth method
is not gitcookies".
This presumable makes 'git cl' work on LUCI in a consistent manner. Before, it
worked only if the LUCI bot happened to also be GCE bot.
R=tandrii@chromium.org
BUG=891755
Change-Id: I2caa219a4082438a5e026e728bfb62f46a0c80fd
Reviewed-on: https://chromium-review.googlesource.com/c/1260053
Commit-Queue: Vadim Shtayura <vadimsh@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Parses git diff for changed python files in a method similar to
clang-diff and feeds the resulting line ranges into yapf.
Also sets the default style to the yapf file included in depot tools
by searching parent directories of each changed file to find a yapf
style config (.style.yapf). If none is found the default style
file will be the chromium .style.yapf included in depot tools.
Note: Even if line ranges are specified, yapf will fix indentation
issues for the entire file.
This is intended see https://github.com/google/yapf/issues/499
This may cause some issues if git cl format is run on a file
with lots of indentation issues or on a file or when run on a
third_party file that is formatted with pep8 and does not include
a .style.yapf and may make many more changes then the user expects.
Still undecided on whether this should be turned on by default but
if not I think the non --full support is a positive change anyways.
Bug:846432
Change-Id: Ib85797f4a8e1021870901ff465ec10f7e70deb87
Reviewed-on: https://chromium-review.googlesource.com/1249642
Commit-Queue: Aiden Benner <abenner@google.com>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
This removes 1 RPC when tbr-ing second or later patchset.
Since tests cover TBR only in first upload, there are
no test changes. Since adding test is real PITA here,
keep them as is.
R=ehmaldonado
Change-Id: I90801b06727ce2131a703d6cd6c24ffad798bc8a
Reviewed-on: https://chromium-review.googlesource.com/1242212
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Print "git cl comments" json to stdout when the output file is "-"
Change-Id: I91021317e52019a0d499cccc4f40f062127b300e
Reviewed-on: https://chromium-review.googlesource.com/1228094
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>