agents/rules/git-cl.md
These rules ensure correct usage of the Chromium-specific git cl tool in V8.
git cl format before creating a commit or uploading a
CL.-t and/or --commit-description for git cl upload
instead of the deprecated -m flag, to avoid interactive editors.git cl upload), prefix the command with EDITOR=cat (e.g.,
EDITOR=cat git cl upload) if there is a risk of an editor opening.git cl upload -t "Brief description of what changed".git cl upload --commit-description=+ to set the description from the
commit message.-t to provide a patchset message that very briefly summarizes the
differences since the last patchset (e.g.,
git cl upload -t "Address review comments",
git cl upload -t "Fix lint in parser.cc",
git cl upload -t "Add unit test for edge case"). Avoid using
--commit-description=+ by default, as it can combine messages or overwrite
the main description incorrectly. Preferred is omitting it unless modifying
description intentionally.--commit-description="New cohesive description content".git diff is not empty before uploading.gm.py or
check_and_test.sh) indicates that it is unnecessary.git worktree to create an
isolated workspace for each independent task or CL. NEVER upload a CL from a
workspace containing unrelated modifications. Always verify that the diff
relative to upstream contains ONLY the intended changes before uploading.git cl upload detects external
changes on Gerrit and prompts to fetch them or override, the agent MUST stop
and ask the user for guidance, unless explicitly instructed otherwise.v8-workflow skill (e.g., branch vs. worktree).git cl issue 0.git cl status to
verify the Issue Description matches your task.git show --stat) or
run git diff --name-only origin/main..HEAD to ensure no unrelated files
are included. If you see commits or files that are not part of your specific
task, reset your branch to origin/main and cherry-pick only your intended
commits instead of uploading.git cl status before proceeding, and consult the user if it seems
mismatched..cc, .h, .js, .py) are
modified using git diff --name-only origin/main.git cl status after uploading. If
you identify failing checks or try jobs, proactively suggest addressing these
alerts to the user.chromium-review.googlesource.com link to the
user.git cl issue).git cl issue <cl_number>.git cl comments.git cl comments.When working on a chain of dependent changes (stacked CLs):
git branch --set-upstream-to=parent-branch). The base branch
at the bottom of the stack tracks origin/main.Change-Id.
Make sure to remove Change-Id from commit messages of new CLs.git cl patch <CL_NUMBER> to fetch and checkout the latest patchset of a
CL.git cl land to land the CL after approval.git cl desc to view or edit the CL description.