This skill provides instructions for uploading CLs to Gerrit without interactive prompts.
To discover what (if any) issue (often referred to as a CL or Gerrit Change) is associated with the current branch:
git cl issue:git cl issue
This will print the issue number and URL if associated, or “No issue associated” otherwise.When uploading a branch that is part of a chain of local branches, git cl upload may prompt to update all branches in the chain.
Note: A branch based directly on origin/main is not considered part of a chain.
Action: Ask the user if they want to upload the entire chain or only the current branch. Uploading the entire chain should be the default option presented to the user.
If the user prefers to upload the entire chain:
git cl upload without cherry-pick flags.send_input to send a newline (\n) to the task to confirm.If the user prefers to upload only the current branch:
--cherry-pick-stacked (or --cp) flag:git cl upload --cherry-pick-stackedThis uploads only the current branch cherry-picked on its parent's last uploaded commit, avoiding interactive prompts for other branches.
To avoid the editor opening for the CL description:
--commit-description=+ to use the local commit message:git cl upload --commit-description=+
-T or --skip-title to use the most recent commit message as the title.When an issue is already associated with the branch (verify with git cl issue), and you want to upload an incremental update, strongly prefer using the -m flag. This is the most reliable way to avoid interactive prompts for descriptions.
-m flag to specify a one-line description of the update:git cl upload -m "One-line description of the update"This avoids opening the editor and adds the description as a message for the new patchset.
Presubmit warnings will prompt for y/N. In an automated environment:
y using send_input tool if running in background.git cl upload -d -m "One-line description of the update"
git cl upload --cherry-pick-stacked -d --commit-description=+
Note: Drop --cherry-pick-stacked if the branch is not part of a chain.
If presubmit warnings occur, be prepared to send y to stdin.