# git-numberer **Repository Path**: mirrors_chromium_googlesource/git-numberer ## Basic Information - **Project Name**: git-numberer - **Description**: No description available - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-19 - **Last Updated**: 2025-08-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Git Numberer Gerrit Plugin This plugin ensures commit footers in a repository comply with rules of [Git number footers for Chromium]( https://docs.google.com/document/d/1i0pNHKagCsGxOIT7H44kk2mnTEjV9BdfgBjVleFhBr0/edit?usp=sharing) and is part of the [Git Numberer for Chromium](https://goto.google.com/git-numberer) system. ## Summary For every new **commit C** that is about to be pushed with `git push` or landed using Gerrit API/UI (called *merged* in Gerrit), this plugin ensures: 1. **commit C** having exactly at most one parent, namely **commit P**. 2. **commit P** contains footer `Cr-Commit-Position: refs/foo/bar@{#X}`, where `X` is positive integer. 3. **commit C** contains footer `Cr-Commit-Position: refs/foo/bar@{#Y}` such that `Y = X+1`. There is more to it in the doc [Git number footers for Chromium](https://goto.google.com/git-numberer). ## Plugin structure This plugin consists of verification and generation parts, each working independently of each other, but share common libraries. While each part can be enabled on specific refs independently of another, it's recommended that verifier is enabled on all refs on which generation is enabled. ### Verification Safety comes first. This plugin installs a verifier that ensures that all new commits on **enabled** refs comply with the numbering scheme. The new commits may be created as a result of landing (merging) a Gerrit changelist, or as a result of a git push operation. **NOTE** This is a Gerrit plugin and thus it only works for operations done through Gerrit. Thus, this plugin won't protect from bad commits being pushed by someone with direct access to Git repository filesystem on Gerrit's server. Google's deployment of Gerrit internally calls such access **_direct push**. Such access could be useful to administrators when pushing humongous histories as in during [Chromium + Blink merge](https://www.chromium.org/blink/blink-post-merge-faq), but then administrators are responsible for verification. ### See also: * `git cl` and its fork in [Commit Queue]( https://dev.chromium.org/developers/testing/commit-queue) which generate footers for Rietveld issues. ## Development ### Get Ready, only once. Follow this [general Gerrit guide first](https://gerrit-review.googlesource.com/Documentation/#_developer) to get basic set up correctly. ### Code/Build/Test Checkout (or symlink) this repo into `plugins/git-numberer` directory inside primary Gerrit checkout. ```bash bazel build git-numberer bazel test git_numberer_tests ``` ## References * [Git number footers for Chromium](https://docs.google.com/document/d/1i0pNHKagCsGxOIT7H44kk2mnTEjV9BdfgBjVleFhBr0/edit?usp=sharing) * TODO(tandrii): make git-numberer a public doc in chromium.org domain: [Git number as Gerrit Plugins](https://goto.google.com/git-numberer) * [Commit Queue](https://dev.chromium.org/developers/testing/commit-queue)