| # Copyright 2026 The Fuchsia Authors. All rights reserved. | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| #### CATEGORY=Code submission and review | |
| #### EXECUTABLE=${HOST_TOOLS_DIR}/revert | |
| ### Generate a pure revert for a submitted Gerrit CL | |
| ## usage: fx revert <gerrit_url> [-m <reason>] [-f <failure_link>] [-b <bug>] [--upload] [--dry-run] [--auto-submit] | |
| ## | |
| ## Revert a submitted Gerrit change using the Gerrit REST API. | |
| ## | |
| ## Arguments: | |
| ## <gerrit_url> Full URL to the Gerrit change (e.g. https://fuchsia-review.googlesource.com/c/fuchsia/+/123456) | |
| ## | |
| ## Options: | |
| ## -m, --reason Custom reason for revert in commit message. | |
| ## -f, --failure-link Link to builder failure or test failure (e.g. go/bbid/... or https://ci.chromium.org/...). | |
| ## -b, --bug Associated bug or issue tracker ID (e.g. 12345 or b/12345). | |
| ## --upload Create and upload the revert CL via Gerrit REST API with Rubber Stamper reviewer. | |
| ## Without --upload, only the plan is printed (dry run). | |
| ## --dry-run Display the planned revert without executing API calls. | |
| ## --auto-submit Apply Fuchsia-Auto-Submit +1 vote to the generated revert CL (default: off). | |
| ## -h, --help Show help message and exit. |