Commit Graph

1267 Commits (e7cc4c93c0942b4034385cb0d2d3cc604df08e9b)

Author SHA1 Message Date
Allen Li e7cc4c93c0 [git_cl] Improve docstring
Bug: b/351071334
Change-Id: Id28e9d87c517ea0ad6c4a939ce85b52fc6f55810
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5723090
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
9 months ago
Allen Li ead6e4d2fc [git_cl] Parametrize cwd in new_from_env
We need to be able to do this from different dirs later.

Bug: b/351071334
Change-Id: I18dd2c71ea52d79a56ccaee88a12be97465b9d2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5723089
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
9 months ago
Allen Li 4986d4a74b [git_cl] Parametrize cwd in ShouldUseSSO
Remove implicit/global assumptions which could affect tests.

Bug: b/351071334
Change-Id: Ie266228f404b768cb539fdc17dddbbb13693e939
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5723208
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
9 months ago
Allen Li dbebea0aa2 [git_cl] Add apply_global
Bug: b/351071334
Change-Id: I235eb26cd46a82251b3a757edd37961bce067522
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5719714
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
9 months ago
Allen Li 2fe4794943 [git_cl] Fix cookie setting
Bug: b/351071334
Change-Id: I0245e38b71b8c65e77dcc2aeee040121c725b440
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5718644
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
9 months ago
Allen Li fa224cdb07 [git_cl] Add _shortname property
Removes redundant param

Bug: b/351071334
Change-Id: I1040f72df49851fe87e5ea9bf5e9e2fb50ca46b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5718640
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
9 months ago
Allen Li 5a723500c0 [git_cl] Add _base_url property
Makes __init__ a bit cleaner, and planning to make _shortname a
property also next, since it can be derived from _remote_url

Bug: b/351071334
Change-Id: I12f4363723172a9cdaba37f6beb8fa37bbf09d72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5718639
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Allen Li 8715e8e64d [git_cl] Let creds-check revert new auth config changes
Gated this behind new auth flag explicitly being set (so people who
haven't set anything = default off don't run this, just in case)

Bug: b/351024645
Change-Id: I8498b98404ad89d3ca390d3baa798daee0b4b53b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5698379
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li fa55ddf571 [git_cl] Move git new auth config version to constant
Bug: b/351024645
Change-Id: I9454c6678d5754d21d6db9ac1574266e9127034f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5698378
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li e4d053ae47 [git_cl] Make mode attribute public
So it can be overridden if needed.

Bug: b/351024645
Change-Id: I6ff5388cefeae00b1ec21e822e127b0eec349428
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5698628
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Allen Li 1feb63c434 [git_cl] Rename infer_and_create
Didn't like the old name, finally came up with a better one

Bug: b/351071334
Change-Id: I79ca52f3fa821a2348b64e9215d0fd89cf425328
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5698627
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li 55fc2f8208 [git_cl] Move cwd param to apply method
This feels like bikeshedding, but semantically, we are applying the
changes to a specific repo, and you could take one
GitAuthConfigChanger and apply it to multiple different repos.

(The config host, etc. are usually tied to a specific repo, so there
needs to be some further refactoring to make this actually decoupled
from the working directory, but keeping this small for sane code
review)

Bug: b/351071334
Change-Id: I756f1134be516e19e26e35ffca7f7ceb389aaa30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5699189
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Allen Li c0f7c05c50 [git_cl] Fix missing variable
Bug: b/351071334
Change-Id: I337dc37c69be6eb2197bda23098506eb1ab90709
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5709132
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li 9b51399218 [git_cl] Apply OLD_AUTH if new auth flag is off
Note that this logic still isn't run yet, because we only call
ConfigureGitRepoAuth behind new auth flag checks.

Bug: b/351024645
Change-Id: Idca4d1ce3ebd3f2c673f244f85b3cae6da39f8e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5699188
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li 211104a00e [git_cl] Factor out _infer_mode() helper
Bug: b/351024645
Change-Id: Ia016f89f72a836eccfb8cbcb2c18508b4370e1c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5699187
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Robert Iannucci 779f70fd7c [gerrit_util] Move Authenticator to be private in gerrit_util.
This should help give additional confidence while refactoring in
gerrit_util.

R=ayatane, yiwzhang

Change-Id: I03927e072e62f6109571ab699f90db7c51ccc6c0
Bug: b/335483238
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5665455
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Allen Li d5b4ad8c33 [git_cl] Fix typo
Bug: b/351024645
Change-Id: I4a93abd223b8539e0e58d54d8f9d6937ae3bb111
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5698747
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li 8cbc31803e [git_cl] Add some type annotationes
Bug: b/351024645
Change-Id: I0a5c1a61a5cb49db6249f94d0467ac9d5e05f170
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5698746
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li e7e9ac6699 [git_cl] Add set_config_func parameter
Used to inject git dependency

Bug: b/351024645
Change-Id: Ie5e1f5a18b722a16f236e89c33510c961738d40d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5692553
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li c3b1e5e58b [git_cl] Adding OLD_AUTH config mode
Can be used to remove config changes.  Not called yet.

There's some logic duplication, will try to clean up later.

Bug: b/351024645
Change-Id: Ibdda4b93e600efc4b84240374e58478e2cc1501a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5693419
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li 57000ea275 [git_cl] Use enum to configure git auth
Will add "old auth" mode later to revert new auth opt in

Bug: b/351024645
Change-Id: Ifd283e484912692bdc50f087758234b4ea34f1b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5693418
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li b95dd2fd95 [git_cl] Organize imports
Separate stdlib and depot_tools, and from imports

Change-Id: I88e40ca07215d918d1354472d9d16c6babef54d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5691997
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Allen Li 2dbc9febdd [git_cl] Move debug logging
Change-Id: I2c9a621c5c0e8317b412e7896261150317f03cba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5691996
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li 6f8fc5132b [git_cl] Factor out _apply_gitcookies
I'm planning on adding removal for all of these, so sectioning
everything out.

Change-Id: Ieb4369a267dff323cd644cff00d98761800a8a90
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5691995
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li def8acd0a1 [git_cl] Factor out cwd param
Change-Id: I2f0b92bd5226d207e1432f14362966cbe5eab8da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5691994
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li 8ebbd5189d [git_cl] Dedupe config key strings
Change-Id: Iffdbc1247860b97cb2e9f923f74e07d30e3b5f2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5690582
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Allen Li dd8cc1ce96 [git_cl] Extract use_sso as an argument
Potentially makes it easier to test (needs more deps extracted and
injected though).

Change-Id: I3a300264f85f4420d8b41a7cd1155e38341638f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5689683
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li c5b7ca4f7f [git_cl] Extract construction inference
Potentially makes it easier to test (needs more deps extracted and
injected though).

Change-Id: I8c551b39c97ec95291995e614c760073b10a4615
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5689682
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Allen Li 902a9de39e [git_cl] Extract helper methods
Change-Id: I6fd49699a7046d7f689ef59bf35d3d2a62c7438d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5689681
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li 6b6a0ff40b [git_cl] Extract GitAuthConfigChanger
Makes it easier to extend for following CLs, keeps things organized

Change-Id: I153501ead2ad9592eca94f7fe2bc7344ea6efc22
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5688608
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Allen Li 93d8c0178f [git_cl] Remove bad type annotation
NoReturn applies to functions that never return.  Doesn't make sense
to return None or NoReturn.

Change-Id: I1f1a759999a8dad1c2b2a7fd9623e3ea5216c726
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5688607
Auto-Submit: Allen Li <ayatane@chromium.org>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Daniel Rubery 9e9fc99280 Fallback to looking up CL issue from triplet_id
In nosquash mode, `git cl` is pretty challenging to use since we don't
have issue numbers. All three parts of the triplet id are readily
available though. This CL adds a fallback to `git cl` which looks up the
issue number by getting the change details by triplet_id.

Change-Id: I0839fe75bcb4bc8d60ff36b4da26dc0e419a1493
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5633186
Commit-Queue: Daniel Rubery <drubery@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
10 months ago
Allen Li 41c749b26d [git_cl] Use named fields for URL manipulation
Change-Id: I575b91f6b6e28ac58160e3c0fc59398df222b150
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5677608
Auto-Submit: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Allen Li 6a00e594c9 [gerrit_util] Configure new auth automatically
Because running git cl creds-check in every single repo is poor UX for
early dogfooders.

Bug: b/348024314
Change-Id: Ib5641418de7fa5a55a7f67b7069e63c04403852a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5660338
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Gavin Mak ea802a77b7 Don't show ".gitcookies have credentials" if no creds
Running `git cl creds-check` without any credentials will show:

```
Your .gitcookies have credentials for these hosts:
No Git/Gerrit credentials found
```

The first line of the output should not assume that there are hosts. Don't show this line if credentials are not found.

Change-Id: Ie6eba3518f4b270eef5fbe0c51b4494762a3aef4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5663779
Reviewed-by: Scott Lee <ddoman@chromium.org>
Auto-Submit: Gavin Mak <gavinmak@google.com>
Commit-Queue: Scott Lee <ddoman@chromium.org>
10 months ago
Allen Li 99548b292d [gerrit_util] Fix URLs and hosts in ConfigureGitRepoAuth
Basically there are lots of different formats for everything and
certain things need things in different formats.

Credential helper needs whatever remote the user has configured (which
may or may not have `-review`).

Checking ShouldUseSSO needs the Gerrit host with `-review`.

SSO URL needs the short name (not FQDN), and without `-review`.  I
think.

Anyway, this should work now.  Probably.

Bug: b/348024314
Change-Id: I495686ecfff43c61fe78d72ccd485bc93388e036
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5662256
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li f4e8e13e8b [gerrit_util] Add linked account detection for SSO
Bug: b/348024314
Change-Id: Ic982de2892769870805407c6a00856943133dd62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5651293
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li 9f0e78e146 [git_cl] Append extra credential helper option
Bug: b/348024314
Change-Id: Ic7e1682812edcac878565bd79f002b40c018d95c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5655833
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Allen Li 0d470211d6 [git_cl] Move new auth handling up in creds-check
The CookiesAuthenticator is mutually exclusive with new auth.

Bug: b/348024314
Change-Id: I70f2e1976b54572c330fcc8acff30e8448e540ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5651990
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li cb5a8a3315 [git_cl] Fix ShouldUseSSO call
(This did not error since this code path is unreachable, to be fixed
in future CL)

Bug: b/348024314
Change-Id: I115b36a828d5e525c54cebdbec5480514e395da7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5651989
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li 3a5d348a0b [gerrit_util] Add ShouldUseSSO helper
Bug: b/348024314
Change-Id: I5b061bc6afeffbc84aee12250732e96a0ad0f32b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5651287
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li 6359e82d13 [git_cl] Add new auth support for creds check
Bug: b/348024314
Change-Id: I157380b19121a9fbcee2a1a13447df9c03f7bccc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5646659
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Robert Iannucci 005e60ceda [git_cl] Make EnsureCanUploadPatchset work for all auth methods.
Previously EnsureCanUploadPatchset only had a working implementation
for the CookiesAuthenticator, relying on being able to parse the
user name out of the .gitcookies file.

Additionally, the previous implementation assumed that you would
always authenticate as your primary Gerrit account OR you had
a matching `user.email` gitconfig entry, even though neither of these
is a strict requirement for the upload to work.

The new implementation still short-circuits if issue_owner matches
the configured user.email, but other than this it just asks Gerrit
what the full list of linked emails is for the currently authenticated
account.

The new approach is not only correct, but will now work for all auth
schemes in exactly the same way.

When the accounts do mismatch, you will now see output like:

```
WARNING: Change 5590262 is owned by iannucci@chromium.org, but Gerrit knows you as:
  * user@example.org
  * other.user@example.com
  * primary@real.example.com (preferred)
Uploading may fail due to lack of permissions.
```

R=ayatane@chromium.org, yiwzhang@google.com

Bug: 336351842
Change-Id: I89c1b121c9110e00d1348884aaf025fc783542d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5590262
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
10 months ago
Robert Iannucci 6daca50597 [git_cl] Refactor EnsureAuthenticated logic.
This will allow us to implement EnsureAuthenticated for other
Authenticator implementations.

R=ayatane@chromium.org

Bug: 336351842
Change-Id: I5ff4efd45eb5baa6baa048842510ec6e18e1b8fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5588510
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Scott Lee <ddoman@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
10 months ago
Allen Li 06673958a3 [git_cl] Fix comment about GetCodereviewServer
Previous comment was... lacking.  Actually, wrong.  It's doing the
exact opposite of lazy loading.  Maybe they were trying to use AI code
gen before it existed?

Bug: b/348024314
Change-Id: I068d43fe1abf757cb8b109890a14ca0cefe3fec0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5641090
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Yiwei Zhang 66df2a3ec7 git cl upload: introduce commit-description option
This new option allows programatically providing new
description when uploading a new patchset.

Bug: 346174899
Change-Id: I6d7e361b7da0fd06675c04df4fd2f68c7954dd40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5620640
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
11 months ago
Aleksey Khoroshilov 093f878224 Fix java format with --diff passed
Accidentally removed few parameters in [1].

1. https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5613673

Change-Id: I944370d13d86980a1dabadb8c9eda69d078de0f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5632781
Reviewed-by: Gavin Mak <gavinmak@google.com>
Auto-Submit: Aleksei Khoroshilov <akhoroshilov@brave.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
11 months ago
Aleksey Khoroshilov c0883c509e Fix git diff calls when a lot of files modified in a branch
Running a command line longer that 32k on Windows lead to issues (as
usual). We run git diff in multiple scenarios on a list of changed
files. This list is not partitioned and may lead to a command line
much longer than OS can allow.

This change replaces BuildGitDiffCmd with RunGitDiffCmd that splits
the file list internally and runs git diff multiple times if required.

Change-Id: Icfd8efc7520105b8d98125e90bb96c2bb9bd3a0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5613673
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Aleksei Khoroshilov <akhoroshilov@brave.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
11 months ago
Ben Pastene fd85601398 git_cl: Remove support for '--clobber' arg
The chromium recipe (and only the chromium recipe?) currently reads this
prop to trigger a clobber build. But support for that in the recipe is
being removed in https://crrev.com/c/5620860. So this removes the
ability to set that arg via `git cl try`. Across all chrome/chromium
builders, that arg was only passed in six builds in the past year. So
it's very unlikely anyone depends on it, or will notice it's gone.

Bug: 346363294
Change-Id: Icf05c9a2fd6f2e9239c735e4c5507aee9a26e0e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5620634
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
11 months ago
Robert Iannucci 6427b94bc2 [git_cl] Refactor EnsureAuthenticated.
This will allow us to invert the main Authenticator API.

R=yiwzhang@google.com

Bug: 336351842
Change-Id: Iebe06f68373b99685809849bcd96371e7634d6ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5582406
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
11 months ago