Agent skill · kevmoo

gerrit-stacked-cls

Best practices for managing stacked changelists (CLs) in Gerrit using depot_tools, avoiding common pitfalls with Change-Ids.

What it needs

About 2k tokens when loaded.

What this skill does

1. When to use this skill Use this skill when you need to create, update, or manage a chain of dependent changelists (CLs) in Gerrit (stacked CLs) for the Dart SDK or similar repositories using Chromium's depottools. 2. Core Concepts Relation Chain: Gerrit links commits together based on their parent-child relationship in the pushed git history. Change-Id: Gerrit identifies a CL by the Change-Id: line in the commit message. Commit Hash: Gerrit identifies a Patchset within a CL by the git commit hash. 3. Procedural Workflows Creating Stacked CLs 1. Start with the base CL: 2. Create the dependent CL: Create a new branch on top of branch1. Gerrit will automatically create a relation chain. Updating a Specific CL in a Stack To update a specific CL without confusing Gerrit, you must ensure that the commit you push has the correct Change-Id and that it is the last Change-Id in the commit message if multiple are present (though ideally, keep only one). Method A: Amending (If allowed by user rules) If allowed to amend, this is the cleanest way: 1. Checkout the branch for the CL you want to update. 2. Make changes. 3. Run git commit --amend. Keep the original Change-Id line intact! 4. Run git cl upload. Method B: New Commit + Squash (Following strict no-amend rules) If forbidden from amending active PRs: 1. Make changes on the branch. 2. Commit as a new commit (generating a new Change-Id). 3. To update the existing CL on Gerrit without creating a new one: Squash the new commit into the previous one using git reset --soft HEAD~2 (assuming one fixup commit) and then committing again. CRITICAL: Ensure the final commit message contains only the Change-Id of the CL you want to update. If multiple Change-Id: lines are present, Gerrit will typically use the last one! Resolving Conflicts in Stacked CLs When rebasing a dependent branch (e.g., branch2) on top of an updated base branch (branch1), conflicts may arise in generated files (like .wat files). 1. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills kevmoo/gerrit-stacked-cls

View the source on GitHub

Browse the @skills marketplace