sds/overcommit
62.5
Adequate · 28 September 2026
7.6k
lines of production code
Ruby
primary language
2
measurements over time
What this system is
Overcommit is a configurable Ruby gem that manages Git hooks to automate code validation and repository maintenance. It provides a framework for running linters, dependency installers, and branch protection checks across various Git lifecycle stages, including pre-commit, pre-push, and post-merge. The system supports custom hook plugins with signature verification and handles cross-platform execution details to ensure consistent behavior.
How it got here
2011–2014 — Initial framework release and core development
21 changes.
This period marks the initial release of the Overcommit gem, establishing a configurable framework for managing Git hooks with a robust CLI and core library structure. The work focused on implementing foundational hook types (pre-commit, commit-msg, post-checkout) and building a comprehensive test suite to ensure reliability across various Git operations and environments.
2015 — expansion of git hook categories
10 changes.
This period focused on significantly expanding Overcommit's capabilities by introducing new hook categories: post-commit, post-rewrite, pre-push, and pre-rebase. The work involved building shared base classes and utility modules to support automated dependency installation, linting, and branch protection across these new stages. Comprehensive test coverage was added to ensure the reliability of these new features and the underlying base hook logic.
2016–2020 — Hook stability and new features
4 changes.
This period focused on enhancing the reliability of the Overcommit framework by improving hook context handling for unstaged changes and commit amendments. It also introduced the ReplaceBranch hook to automate branch information in commit messages and resolved Windows compatibility issues with template directory hooks.
Features
Add Gerrit Change-Id generation and repository tag indexing scripts
Two new utility scripts are now available in the libexec directory. The gerrit-change-id script automatically appends a unique Change-Id footer to commit messages when missing, ensuring compatibility with Gerrit code review workflows. The index-tags script generates a ctags index file for the repository, enabling easy navigation of code symbols in Vim (particularly when using Fugitive.vim).
libexec · high confidence
Add post-rewrite hooks for dependency installation and submodule status
This change introduces a new set of hooks that run automatically after git rebase, merge, or commit operations. Specifically, it adds support for running \bundle install\, \yarn install\, \npm install\, \bower install\, and \composer install\ to ensure dependencies are up to date after dependency files are modified. It also adds a \submodule\_status\ hook to check for uninitialized or out-of-date submodules, and an \index\_tags\ hook to update ctags indexes during rebases. These hooks share a common base class and implementation modules to reduce code duplication.
_lib/overcommit/hook/post\rewrite · high confidence
Initial implementation of the pre-commit hook framework and built-in hooks
This change introduces the core \Overcommit::Hook::PreCommit::Base\ class and a comprehensive suite of built-in pre-commit hooks (such as AuthorEmail, AuthorName, BundleCheck, EsLint, RuboCop, and many others). For users, this establishes the foundational structure for the pre-commit system, providing immediate out-of-the-box validation for code style, configuration files, and repository metadata without requiring external hook definitions.
_lib/overcommit/hook/pre\commit · high confidence
Initial release of Overcommit git hook framework
Overcommit is now available as a gem, providing a configurable framework for managing git hooks. It introduces a new command-line interface for installing, uninstalling, and running hooks, along with a configuration system that supports local overrides and signature verification to ensure hook integrity. The framework includes built-in hooks for tasks like code linting and branch protection, supports parallel execution for performance, and handles complex scenarios such as long argument lists and merge/cherry-pick states gracefully.
lib/overcommit · high confidence
Introduce ReplaceBranch hook to auto-prepend branch info to commit messages
Adds a new \ReplaceBranch\ hook for the \prepare-commit-msg\ stage that automatically prepends text to commit messages based on the current branch name. Users can configure a \branch\_pattern\ regex and a \replacement\_text\ (which can be a static string or a file path) to customize the prefix, such as adding issue IDs like \\[\#123\]\. The hook supports skipping execution for specific commit types (message, template, commit, merge, squash) via \skipped\_commit\_types\ and includes logic to avoid running on \--amend\ by default.
_lib/overcommit/hook/prepare\_commit\msg · high confidence
Introduce commit-msg hook support with new validation rules
Overcommit now supports commit-msg hooks, allowing users to validate commit messages at the time of creation. This release adds a suite of new hooks including CapitalizedSubject (enforcing capitalization), TextWidth (configurable line length limits), EmptyMessage (preventing empty commits), MessageFormat (custom regex patterns), SpellCheck, GerritChangeId, and others. The implementation introduces a new base class for commit-msg hooks and updates the hook context to support message inspection and modification.
_lib/overcommit/hook/commit\msg · high confidence
Introduce post-commit hooks for dependency installation and repository checks
This change adds a new \post\_commit\ hook category to Overcommit, allowing users to run checks and commands after a commit is created. The initial set of built-in hooks includes dependency installers for Bower, Bundler, Composer, NPM, and Yarn, which automatically run their respective install commands when dependency files change. Additionally, new hooks are provided to check submodule status, update ctags indexes, run git-guilt blame analysis, and enforce commit message styles via commitplease. A shared base class provides common context methods like \initial\_commit?\ to these hooks.
_lib/overcommit/hook/post\commit · high confidence
New post-checkout hooks for dependency installation and submodule status
This change introduces a new base class for post-checkout hooks and adds several new built-in hooks that run automatically after a checkout. Users can now configure Overcommit to automatically run \bundle install\, \npm install\, \yarn install\, \bower install\, and \composer install\ when dependencies change. Additionally, a new \SubmoduleStatus\ hook checks for uninitialized or out-of-date submodules, and an \IndexTags\ hook updates ctags indexes. A new \skip\_file\_checkout\ configuration option allows users to disable these hooks during file-specific checkouts.
_lib/overcommit/hook/post\_checkout, lib/overcommit/hook/post\merge · high confidence
New pre-push hooks for multiple languages and protected branch enforcement
This change introduces a new base class for pre-push hooks and adds support for running various linters and test suites before pushing code, including Go (go test, golangci-lint), Rust (cargo test), Python (pytest, nose), PHP (phpunit), Dart (pub test), Flutter, Elixir (mix test), Ruby (minitest, test-unit, rspec, rake\_target), and security scanning (brakeman, pronto). It also adds a ProtectedBranches hook that prevents force-pushes or deletions to specified branches, with support for configuring destructive-only restrictions globally or per branch using glob patterns.
_lib/overcommit/hook/pre\push · high confidence
New pre-rebase hook to prevent rebasing merged commits
A new pre-rebase hook has been added that prevents rebasing commits that have already been merged into specified target branches. This feature introduces a base class for pre-rebase hooks and a specific \MergedCommits\ implementation that checks if any commits being rebased are already present in configured branches (e.g., main or develop), failing the rebase if so. The hook allows rebasing when the HEAD is detached, as no references are changed in that state.
_lib/overcommit/hook/pre\rebase · high confidence
New shared hook implementations for dependency managers and linting tools
This location introduces a suite of new shared hook modules that enable Overcommit to run specific tooling during git operations. The diff adds shared logic for Bower, Bundler, Composer, NPM, and Yarn install hooks, which automatically execute the respective package manager when dependency files change. It also introduces shared hooks for RSpec (with support for filtering by applicable files), Rake targets (validating that targets are configured), Pronto linting (categorizing output as errors or warnings), Submodule status checks (detecting uninitialized or conflicted submodules), and Index tags (updating ctags in the background). These modules provide the core execution logic for the corresponding built-in hooks.
lib/overcommit/hook/shared · high confidence
New utility modules for Windows symlink handling and message extraction
Added two new utility modules to the codebase: \Overcommit::Utils::FileUtils\ and \Overcommit::Utils::MessagesUtils\. The \FileUtils\ module provides cross-platform support for symbolic links, implementing Windows-specific logic using \mklink\ and \dir\ commands via subprocesses while delegating to standard Ruby \File\ methods on other operating systems. The \MessagesUtils\ module introduces a robust parser for extracting file locations, line numbers, and error/warning types from linter output using configurable regular expressions and type categorizers, raising specific exceptions for malformed output.
lib/overcommit/utils · high confidence
Removals
Removal of Ruby syntax pre-commit hook
The pre-commit hook script located in the hooks directory has been deleted. This script previously executed a Ruby syntax check on staged .rb files before allowing a commit. Its removal means that automatic syntax validation for Ruby code is no longer performed at commit time via this specific hook.
hooks · high confidence
Architecture
Establishes the main library entry point and core module structure
The library now exposes a central \lib/overcommit.rb\ file that serves as the primary entry point, requiring all core components including the OS detection module, configuration loaders and validators, hook runners and signers, git utilities, and the installer. This change consolidates the previously scattered or implicit loading logic into a single, explicit dependency graph, ensuring that all essential classes (such as \HookRunner\, \Configuration\, \GitConfig\, and \Installer\) are available when the gem is loaded.
lib · high confidence
Behavioural changes
Add repository configuration and linting files
The repository now includes standard configuration files to enforce coding standards and manage local artifacts. An \.editorconfig\ file defines consistent coding styles (UTF-8, 2-space indentation, trailing whitespace removal) across editors. A \.gitignore\ file excludes build artifacts, coverage reports, and IDE-specific directories. A \.rubocop.yml\ file configures the RuboCop linter for Ruby 2.6+, disabling specific cops and setting line length limits, accompanied by a \.rubocop\_todo.yml\ file generated to track existing offenses. Additionally, the project's \.overcommit.yml\ configuration is established to enable and tune pre-commit hooks like RuboCop, BundleCheck, and TrailingWhitespace for this repository. The legacy \helper.rb\ script and the old \Rakefile\ installation tasks have been removed in favor of standard Bundler gem tasks.
(repo-wide) · high confidence
CLI now auto-loads Bundler context and handles gem resolution errors
The \overcommit\ binary now automatically detects a \gemfile\ specified in \.overcommit.yml\ and configures the Bundler environment before running. It gracefully handles gem loading issues, such as missing gems or version conflicts, by providing clear error messages and suggesting fixes like running \bundle install\. If a gem is already activated with a conflicting version, it automatically re-executes the command via \bundle exec\ to ensure consistency.
bin · high confidence
Enforce consistency of template directory hooks
A new pre-commit hook has been added to ensure that all hook files in the template directory match the content of the master 'overcommit-hook' file. This change replaces the previous symlink-based approach with a file-content comparison, resolving compatibility issues on Windows where symlinks are not supported. Users will now be notified if any template hook diverges from the master version, with instructions to copy the master hook to fix the mismatch.
.git-hooks · high confidence
Git hook templates now use regular files instead of symlinks
The hook entry-point scripts in the template directory (commit-msg, overcommit-hook, post-checkout, post-commit, post-merge, post-rewrite, pre-commit, pre-push, pre-rebase, and prepare-commit-msg) are now installed as regular executable files rather than symlinks. This change ensures that the hook scripts are copied directly into the repository's .git/hooks directory, which improves compatibility with environments where symlinks are restricted or behave unexpectedly, while preserving the existing hook logic and behavior.
template-dir · high confidence
Improved handling of unstaged changes and amend operations in hook contexts
The hook context helpers now include new modules for managing file modifications and stashing unstaged changes. The \FileModifications\ helper ensures that when a commit is amended, hooks correctly identify files and line numbers changed in both the current and previous commit states. The \StashUnstagedChanges\ helper improves the reliability of stashing and restoring unstaged changes during hook execution, particularly by handling edge cases like initial commits and ensuring file modification times are preserved to avoid triggering unnecessary editor updates. These changes enhance the stability and accuracy of hook runs, especially when amending commits or dealing with complex working tree states.
_lib/overcommit/hook\context/helpers · high confidence
Introduce HookContext abstraction for Git hook integration
The library now uses a dedicated \HookContext\ class hierarchy to manage the state and environment for each Git hook type (such as \PreCommit\, \CommitMsg\, \PrePush\, \PostMerge\, and others). This change provides a unified interface for accessing hook-specific data—like modified files, input lines, and commit messages—while handling necessary environment setup and cleanup (e.g., stashing changes) automatically. Users benefit from more robust and consistent hook execution, as the system now correctly adapts to the specific arguments and input streams provided by Git for each hook phase.
_lib/overcommit/hook\context · high confidence
Plugin hook signature verification and improved error reporting
Overcommit now verifies the integrity of custom plugin hooks before execution. If a plugin file or its configuration has been modified since it was last signed, the hook loader raises an error and instructs the user to run \overcommit --sign\ to update the signature, preventing the execution of potentially tampered or misconfigured code. Additionally, when loading hooks, the system now provides a clearer error message if a custom hook class does not inherit from the required base class, aiding in debugging configuration issues.
_lib/overcommit/hook\loader · high confidence
Refactored hook base class with new configuration and execution options
The base hook implementation has been refactored to support more granular configuration and execution control. Users can now configure hooks using new options such as \command\, \flags\, \env\, \processors\, \parallelize\, \quiet\, \skip\, and \skip\_if\. The \execute\ helper now supports passing standard input and splitting long argument lists to avoid OS command-length limits. Additionally, the \exclude\_branch\_names\ configuration option has been renamed to \exclude\_branches\, and hooks can now return messages alongside their status. The \process\_hook\_return\_value\ method has been moved to private, and the \included\_files\ method is now available for accessing all matching files.
lib/overcommit/hook · high confidence
Test coverage
Add RSpec matchers for hook status and message validation; Add RSpec test suite with code coverage integration; Added comprehensive test suite for Overcommit core components; Added integration tests for Overcommit core features; Added test coverage for hook context classes; Added test coverage for new and updated pre-push hooks; Added test coverage for new post-commit hooks; Added test coverage for pre-commit hooks; Added test support helpers for Git, shell, and output handling; Added tests for Overcommit::Hook::Base behavior; Added tests for PrepareCommitMsg hook concurrency and ReplaceBranch configuration; Added tests for the pre-rebase merged commits hook.
Dependencies
Initial gem release with Ruby 2.6+ support and pinned RuboCop versions
This change introduces the initial gem specification and development environment for the Overcommit Git hook manager. It establishes a minimum Ruby version requirement of 2.6 and defines core runtime dependencies including \childprocess\ (\>= 0.6.3, \< 6), \iniparse\ (\~\> 1.4), and \rexml\ (\>= 3.4.2). The development setup includes RSpec 3 for testing, SimpleCov for code coverage, and a conditional pinning of RuboCop (1.50.0 for Ruby \< 2.7, 1.77.0 otherwise) to ensure consistent CI builds across supported Ruby versions.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 64 → 62 (-1.2)
- Rubric changed (rubric-2026.09.8 → rubric-2026.09.16) — scores are not directly comparable.
Lenses
- Code Health 98 → 98 (+0.0)
- Architecture 100 → 73 (-27.0)
- Maturity 56 → 56 (+0.0)
- Readiness 58 → 58 (+0.0)
- Security 68 → 74 (+6.5)
Resolved (2)
- Documentation: no installation or build instructions (README.md)
- Off-boarding risk: anonymized user #1
New (5)
- Duplicate functionality. Hook.Base exposes in_path? which is identical to Utils.in_path?. Since Utils is the general utility module, Hook.Base should delegate to it rather than duplicating the implementation.
- Inconsistent inheritance for file modification queries. HookContext.Base defines modified_files(), but specific contexts like Diff and CommitMsg also define it, potentially shadowing or duplicating logic. More importantly, HookContext.Helpers.FileModifications is a mixin that also defines modified_files(), creating ambiguity about whether the method comes from the Base class or the Helper module in contexts that include the helper. This suggests a fragmented design for accessing file diffs.
- Off-boarding risk: anonymized user #1
- Projects may be oversized for their cohesion
- Redundant execution abstractions with inconsistent naming and signatures. There are three distinct layers for executing commands: Overcommit.Hook.Base (high-level hook context), Overcommit.Utils (low-level utility), and Overcommit.Subprocess (process spawning). Furthermore, Base and Utils use execute/execute_in_background, while Subprocess uses spawn/spawn_detached. The argument names also vary (cmd vs args vs initial_args), and CommandSplitter duplicates the execute signature found in Utils.
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
sds/overcommit was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 28 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit c06c0f5c47cdcabc782e45d8696b88b02b51514b — the exact code this score is about.
- Scored under rubric-2026.09.16 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-2d9048c36d26.