关于Gerrit变更编号(Gerrit Change Number)的官方文档及弃用疑问咨询
Great question—let's break this down clearly for you:
Official Documentation on Gerrit Change Numbers
Gerrit's official core documentation explicitly references this integer identifier as the Change Number (or sometimes Numeric Change Number). It’s defined as a unique, sequentially incrementing integer assigned to every change the moment it’s first created in Gerrit.
Key details from the official docs:
- It’s a simpler, human-friendly alternative to the longer, hash-based
Change-ID(the string likeIabc123def456...found in commit messages) - It’s fully supported in Gerrit’s REST API: you can use it to fetch change details with calls like
GET /changes/{change-number}, update review statuses, or manage change metadata - It’s baked into Gerrit’s default URL structure (e.g.,
https://your-gerrit-instance/c/your-project/+/68for change number 68)
Is the Numeric Change Number Deprecated?
Short answer: No, it’s not deprecated.
Your suspicion of deprecation might stem from seeing more focus on the Change-ID in some contexts (since it persists across repository migrations or rebase operations), but the Change Number remains a first-class identifier in Gerrit:
- Gerrit’s web UI still prominently displays and uses it in URLs
- The official API and command-line tools (like
gerrit query) continue to support it fully - There’s no official announcement or roadmap item indicating it will be removed
- Many long-running Gerrit instances and third-party integrations (CI/CD pipelines, custom scripts) rely heavily on it for day-to-day operations
Key Roles in the Gerrit Workflow
Even with the Change-ID available, the numeric Change Number stays critical for several reasons:
- Easy communication: It’s far simpler to say "check change 68" than recite a 40-character hash
- Quick navigation: Typing the integer into a Gerrit URL is faster than searching for a
Change-ID - Automation & scripting: Its sequential nature makes it ideal for bulk operations (e.g., querying all changes created in a specific range)
- Access control: Gerrit allows admins to set permissions based on ranges of change numbers (useful for restricting access to specific batches of changes)
- Historical context: The incrementing sequence lets you quickly gauge the age or order of changes without digging into timestamps
内容的提问来源于stack exchange,提问作者leeyuiwah

