com um clique
devtools-version-control
// Use when managing branches, creating and uploading CLs, or handling stacked changes in the DevTools Gerrit-based workflow.
// Use when managing branches, creating and uploading CLs, or handling stacked changes in the DevTools Gerrit-based workflow.
Migrating unit tests to foundation unit tests using TestUniverse and devtools_foundation_module. Use when moving tests away from DOM-heavy helpers like describeWithEnvironment or describeWithMockConnection.
MANDATORY: Activate this skill ANY TIME you need to build the project, run tests, or verify code health in DevTools. You MUST use this skill before executing commands like npm test, npm run build, autoninja, or linters, as it contains critical, repository-specific instructions on how to correctly format these commands, filter test runs, and interpret failures.
Conventions for importing code in Devtools to avoid build errors. Covers cross-module imports, internal imports, and the "import * as" requirement.
Workflow for merging a DevTools submodule into its parent module. Covers BUILD.gn consolidation and updating devtools_grd_files.gni.
Guidelines for building UI widgets using the MVP architecture in DevTools. Covers Widget lifecycle, lit-html views, and state management.
| name | devtools-version-control |
| description | Use when managing branches, creating and uploading CLs, or handling stacked changes in the DevTools Gerrit-based workflow. |
Chrome DevTools uses Gerrit for code review. The standard workflow is one branch per Change List (CL) and one commit per branch. Instead of multiple commits, you amend your single commit locally.
To start a new task, create a new branch from main:
git new-branch <branch-name>
Note: This automatically sets the upstream to origin/main.
git add <files>.git commit -m "Your message".To update your CL after feedback or more work:
git add <files>.git commit --amend.If CL B depends on CL A:
git new-branch --upstream_current <branch-B>
If you need to change the base of a branch (e.g., move CL B to be based on main instead of CL A):
git reparent-branch main
Or to make it depend on another branch C:
git reparent-branch <branch-C>
To update all your branches with the latest changes from main and their respective upstreams:
git rebase-update
When a CL is ready, upload it with:
git cl upload -d --commit-description="<description>"
To upload an updated CL:
git cl upload -d -t "<one sentence patch set description>"
| Action | Command |
|---|---|
| Create new CL from main | git new-branch <name> |
| Create stacked CL | git new-branch --upstream_current <name> |
| Update current CL | git commit --amend |
| Upload to Gerrit | git cl upload |
| Change branch parent | git reparent-branch <new-parent> |
| Sync all branches | git rebase-update |
commit --amend.git checkout -b: Does not set up tracking information correctly for depot_tools. Use git new-branch.git rebase-update or git reparent-branch to let depot_tools handle the tracking updates.