Commit graph

16 commits

Author SHA1 Message Date
Pierre-Clément Tosi
797de4a579 tools/cl: Add support for SSO Git remote
Some users of *.googlesource.com access the platform through the
internal Single Sign-On authentication mechanism so consider the sso://
remote as valid.

TEST=tools/cl upload

Change-Id: Ie7ebe4c9e165241645fddcdf1884b7e9e7a7d83d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5009550
Auto-Submit: Pierre-Clément Tosi <ptosi@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-11-07 17:55:30 +00:00
Dennis Kempin
a7b5a94480 tools/cl upload: Add a few convenience flags
--try: set CQ+1
--autosubmit: Set Auto-Submit and CQ+1
--submit: set CQ+2
--reviewer: Set a username as reviewer

BUG=None
TEST=This CL was uploaded with:
tools/cl upload --autosubmit -r dverkamp

Change-Id: I1ec9834d2f5d365eaa500e8e5915c77a4f066c6b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3997873
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-11-02 20:20:47 +00:00
David Stevens
aad6a554dc tools/cl: add confirmation for multi-cl uploads
Add a confirmation if multiple changes are being uploaded. This can help
catch errors such as being based on the wrong branch.

BUG=None
TEST=manual testing

Change-Id: Ia7ea75564628e25b09eda894bf45bd2a3f9e4f26
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3960214
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: David Stevens <stevensd@chromium.org>
2022-10-20 00:54:27 +00:00
Dennis Kempin
1dab58a2cf Update all copyright headers to match new style
This search/replace updates all copyright notices to drop the
"All rights reserved", Use "ChromiumOS" instead of "Chromium OS"
and drops the trailing dots.

This fulfills the request from legal and unifies our notices.

./tools/health-check has been updated to only accept this style.

BUG=b:246579983
TEST=./tools/health-check

Change-Id: I87a80701dc651f1baf4820e5cc42469d7c5f5bf7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3894243
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-09-13 18:41:29 +00:00
Dennis Kempin
a91002bb46 tools/cl: Identify cl's by Change-Id
Otherwise we won't be able to find the corresponding gerrit change
if the commit has been ammended.

BUG=b:239840337
TEST=./tools/cl status

Change-Id: I5a9673414145a0dcc0547c1de6422992478a3094
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3885076
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-09-08 20:22:26 +00:00
Dennis Kempin
232e17c6dd Add tests for ./tools/cl
Makes a temporary copy of the git repo for each test so we can
modify the repo for testing purposes.
It's not the fastest test (~12s), but is only run when python files
have been modified. In contrast to other developer tooling, tools/cl
is not used by Luci, so it needs a dedicated test.

BUG=b:244185215
TEST=./tools/health-check

Change-Id: I06c90a580aa8ed0fa267a41ca40895710121767f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3866692
Tested-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-09-06 17:14:34 +00:00
Victor Ding
cb243d3ef0 tools/cl: add 'fetch origin' before 'checkout -B'
'checkout -B' would fail if 'origin' isn't fetched or is too outdated.

BUG=None
TEST=tools/cl # on a repo where 'origin' isn't fetched

Change-Id: I13a5d8a3796c4c9002243902a5f8d145dc9393ef
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3844820
Tested-by: Victor Ding <victording@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Victor Ding <victording@chromium.org>
Auto-Submit: Victor Ding <victording@chromium.org>
2022-08-23 04:40:38 +00:00
Dennis Kempin
43056010ab tools/cl: Always upload to origin/main
Even though the remote tracking branch may be different. We want to
upload to origin/main.

BUG=b:242822949
TEST=from a cros/chromeos tracking branch: ./tools/cl upload

Change-Id: Iff35092f019c1f34773f72b20cc955990ec13a2a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3833641
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-08-18 16:53:24 +00:00
Daniel Verkamp
5a4ed32368 tools/cl: add prompt to set upstream branch if missing
When running tools/cl on a branch without an upstream set, ask if the
user would like the script to fix it automatically.

BUG=None
TEST=tools/cl upload # on a new branch with no upstream

Change-Id: Id5f4ee30058a209ac352013159d09278cd92a23b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780873
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-21 21:51:48 +00:00
Daniel Verkamp
32ba2688bb tools/cl: add prune to usage text
BUG=None
TEST=tools/cl --help

Change-Id: If4e632b00b04c9ab4644c37c039372969abf8c3a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780872
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-07-21 21:44:18 +00:00
Dennis Kempin
290622c389 tools/cl: Always run prerequisites
It was missing in some commands. Also runs them when no command
is specified. This will ensure the git hook is installed and
print documentation when calling: "./tools/cl"

BUG=b:239823229
TEST=./tools/cl

Change-Id: Id2248310011f4692cf477ac51d52b578d2f00a8d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780868
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-07-21 18:50:48 +00:00
Daniel Verkamp
57470a47d0 tools/cl: don't try to prune branches with no upstream
This cleans up the output a bit when there are many local branches that
don't have an upstream configured.

BUG=None
TEST=tools/cl prune

Change-Id: Ic5892dcbca315613682326c5615fce28d49b421d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764046
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
2022-07-15 22:58:46 +00:00
Dennis Kempin
53c7515c3f tools/cl: Add prune command
The prune command will delete all branches with gerrit changes
that have been submitted.

BUG=None
TEST=./tools/cl prune

Change-Id: I2f942591e6e29a16d1ed6655655ef9f8cb4fd34f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3765345
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-07-15 21:29:36 +00:00
Dennis Kempin
ed7d455a43 Switch main crosvm repo
This updates all references to chromiumos/platform/crosvm to
crosvm/crosvm.
It will also switch ./tools/cl to upload to the new main repository.

BUG=None
TEST=None

Change-Id: I1f71e5d5de2300e57ace1315cb4553f68533d576
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3760903
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-07-14 17:58:26 +00:00
Dennis Kempin
382acd20d3 tools/cl: Support worktree checkouts
CrOS checkouts are experimenting with using git worktree, where
the path to the hook directory is not .git/hooks. So ask git
where the hooks are stored instead.

BUG=b:236645893
TEST=./tools/cl upload in a worktree checkout

Change-Id: Ib353da0aea5d27ce29d1c082268a326adb429d23
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3739373
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-07-06 18:02:43 +00:00
Dennis Kempin
59cfdaaff0 tools: Add tools/cl script as a helper for uploading to gerrit
See USAGE for documentation.

This tool will be needed to upload to the upstream repository, as
we will no longer be able to use repo.

Currently, for testing it still points to the chromiumos repository.

BUG=b:221088786
TEST=Follow USAGE

Change-Id: I4a8d88a8354942f0ddfb7f9420ef1cf7f5885867
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3687419
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-06-03 21:35:31 +00:00