Yiwei Zhang
e0a877ed8f
Revert "git_auth: Handle conflicting stale local config"
...
This reverts commit e96cff71c9 .
Reason for revert: causing https://issues.chromium.org/466343784
Original change's description:
> git_auth: Handle conflicting stale local config
>
> As we prefer configuring the global config, it's possible to leave
> stale local config behind if the user is swapping between emails.
>
> Change-Id: I86e2cda33a90b603e52d525fcb564fb0a5a68eab
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7213753
> Reviewed-by: Gavin Mak <gavinmak@google.com >
> Commit-Queue: Allen Li <ayatane@chromium.org >
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Iec8ce86a6d17b26e5cc3940a38c6510ad3f855be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7231141
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com >
Auto-Submit: Yiwei Zhang <yiwzhang@google.com >
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com >
2025-12-05 09:56:59 -08:00
Allen Li
e96cff71c9
git_auth: Handle conflicting stale local config
...
As we prefer configuring the global config, it's possible to leave
stale local config behind if the user is swapping between emails.
Change-Id: I86e2cda33a90b603e52d525fcb564fb0a5a68eab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7213753
Reviewed-by: Gavin Mak <gavinmak@google.com >
Commit-Queue: Allen Li <ayatane@chromium.org >
2025-12-04 15:15:29 -08:00
Allen Li
1acf6d271e
git_auth: Configure both variations of Gerrit hosts
...
ChromeOS sometimes uses -review URLs, so we should support both
Bug: 419182970
Change-Id: I9a3836f5544a8422ccda8ded6e9d88d5a10edda2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7173365
Commit-Queue: Allen Li <ayatane@chromium.org >
Reviewed-by: Gavin Mak <gavinmak@google.com >
2025-12-02 16:35:21 -08:00
Allen Li
02f950a7cd
git_auth: Add test for url rewrite override case
...
To prevent possible future regressios
Change-Id: I873be512b621f57f1dd9f54a68d093cd65228bf0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7164718
Reviewed-by: Gavin Mak <gavinmak@google.com >
Commit-Queue: Allen Li <ayatane@chromium.org >
2025-11-18 15:43:06 -08:00
Allen Li
da1bb1b99d
git_auth: Delete unused ConfigChanger
...
All usages have been removed a while ago.
Bug: 446999231
Change-Id: I40de9de7dc027c22652dd45ad75bbba3377bd923
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7082062
Reviewed-by: Gavin Mak <gavinmak@google.com >
Commit-Queue: Allen Li <ayatane@chromium.org >
2025-10-28 14:00:42 -07:00
Allen Li
342cd35666
[git_auth] Add useHttpPath config for Gerrit auth
...
This is needed to pass the repo path to the credential helper, so we
can distinguish repos that need ReAuth.
Change-Id: I5aa72d6ec0421dcbff610f48f34129b8962050f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6822598
Reviewed-by: Gavin Mak <gavinmak@google.com >
Commit-Queue: Allen Li <ayatane@chromium.org >
2025-08-07 14:07:49 -07:00
Allen Li
d28539d200
[git_auth] Move gitcookies to free backup name
...
Bug: 410576093
Change-Id: Ib2d9db97f4e4e1e8cfe1914ba7ffb881f9e16bbf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6453918
Reviewed-by: Yiwei Zhang <yiwzhang@google.com >
Commit-Queue: Yiwei Zhang <yiwzhang@google.com >
Reviewed-by: Gavin Mak <gavinmak@google.com >
2025-04-15 14:54:46 -07:00
Allen Li
3b66d05bd8
[git_auth] Inject Changelist dependency into ConfigWizard
...
Otherwise it creates a dependency cycle. This is needed if we want to
recurse into submodules. Maybe this should be refactored more, but
this should be an improvement for now.
Change-Id: I4641e9ce1952bba81f717acbeefd59dd687d87ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6448579
Reviewed-by: Yiwei Zhang <yiwzhang@google.com >
Commit-Queue: Allen Li <ayatane@chromium.org >
2025-04-14 13:33:58 -07:00
Allen Li
a0d13c9549
[git_auth] Use pathless URL for cred helper
...
The credential helper rules should not have a path, while the URL
rewrite rules should.
Reland of I79b52ab4af62367363617b2a9afa03a67f5ea0b9
Bug: b/401338175
Bug: b/403635929
Change-Id: Ib89d9e855ca5eba29cc67f8846bb7ca0cb3622ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6363080
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org >
Commit-Queue: Allen Li <ayatane@chromium.org >
2025-03-18 14:38:56 -07:00
Allen Li
8fecc592a2
Add auth config wizard
...
Make this available for testing first.
This should be functionally roughly analogous with the current auto
configuration logic, and it prints all actions it performs so it
should be pretty safe to play with, even if it hypothetically
misbehaves.
Bug: b/401338175
Change-Id: I803c7e167e355ec8cca1f5959099138c2fee305e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6334614
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org >
Commit-Queue: Allen Li <ayatane@chromium.org >
2025-03-14 17:00:13 -07:00
Josip Sokcevic
948edc4382
Revert "[git_auth] Use pathless URL for cred helper"
...
This reverts commit ce47e785fa .
Reason for revert: fatal: --local can only be used inside a git
repository.
Original change's description:
> [git_auth] Use pathless URL for cred helper
>
> The credential helper rules should not have a path, while the URL
> rewrite rules should.
>
> Bug: b/401338175
> Change-Id: I79b52ab4af62367363617b2a9afa03a67f5ea0b9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6345631
> Commit-Queue: Allen Li <ayatane@chromium.org >
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org >
Bug: b/401338175
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Ifa887eeb7a7049665570e865431b41ac18649b90
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6357165
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com >
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org >
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com >
2025-03-14 15:06:10 -07:00
Allen Li
ce47e785fa
[git_auth] Use pathless URL for cred helper
...
The credential helper rules should not have a path, while the URL
rewrite rules should.
Bug: b/401338175
Change-Id: I79b52ab4af62367363617b2a9afa03a67f5ea0b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6345631
Commit-Queue: Allen Li <ayatane@chromium.org >
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org >
2025-03-14 13:42:33 -07:00
Allen Li
8eff9d233f
[auth] Add test for overwriting global SSO rewrite rules
...
Sanity check for attached bug
Bug: b/390219533
Change-Id: I788e6beaa7f838568714b98b6f7923d455e6e3a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6178580
Commit-Queue: Allen Li <ayatane@chromium.org >
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org >
2025-01-21 14:18:18 -08:00
Allen Li
877b1e3cbd
[auth] Hide global SSO rewrite in local repo
...
If the user uses SSO (and thus has SSO rewrite rules) for their global
config, a repo which locally uses an email that doesn't use SSO needs
an override.
Bug: b/390219533
Change-Id: I639dae4c1a45bbd2c17180855c22260979b0dbc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6177780
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org >
Commit-Queue: Allen Li <ayatane@chromium.org >
2025-01-21 13:59:20 -08:00
Allen Li
a40df24c91
[git_auth] Add apply_global tests
...
Bug: b/351024645
Change-Id: I54e55545c27275165b3435707e2b47095c8fcac9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5739434
Reviewed-by: Yiwei Zhang <yiwzhang@google.com >
Commit-Queue: Allen Li <ayatane@chromium.org >
2024-08-12 19:39:00 +00:00
Robert Iannucci
283661a975
[scm] Add key canonicalization to scm's CachedGitConfigState.
...
This will allow `git cl` to be much more consistent with regards to
setting and reading git config key values in both production and
testing.
R=ayatane, yiwzhang
Change-Id: I2f1f1c5c6aaab12e2e9dbcf36c181244706cd4a8
Bug: 357688295
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5762199
Reviewed-by: Yiwei Zhang <yiwzhang@google.com >
Commit-Queue: Robbie Iannucci <iannucci@chromium.org >
2024-08-09 00:34:51 +00:00
Allen Li
03434d28f4
[git_auth] Add git_auth tests
...
Bug: b/351024645
Change-Id: Ie8808de63d09c4a89187f81a5782e09fe73c8b0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5698748
Commit-Queue: Allen Li <ayatane@chromium.org >
Reviewed-by: Yiwei Zhang <yiwzhang@google.com >
Reviewed-by: Robbie Iannucci <iannucci@chromium.org >
2024-07-26 19:23:54 +00:00