arxanas/git-branchless
68.9
Adequate · 30 September 2026
36.4k
lines of production code
Rust
primary language
2
measurements over time
What this system is
This system is a Git workflow tool that manages commit history and stack-based development without relying on traditional branch names. It provides commands for rewriting history, navigating commit stacks, recording uncommitted changes, and submitting patches to code review platforms like GitHub and Phabricator. The architecture is modular, separating core library logic, Git hook management, and individual subcommands into distinct crates to ensure maintainability and testability.
How it got here
2020–2022 — modularization and CLI release
24 changes.
The project initialized the git-branchless repository, migrating from Python to Rust and establishing a comprehensive development environment. It introduced the initial CLI with core commands like amend, hide, and sync, while systematically refactoring the codebase into distinct, standalone crates for logic, navigation, and testing. This period also added performance benchmarks, regression tests, and an interactive undo interface to support the new modular architecture.
2023 — Modularization and test coverage
15 changes.
The project refactored its architecture by extracting core functionalities like Git hooks, initialization, querying, and subcommand invocation into dedicated, standalone crates. This modularization was accompanied by the introduction of new features such as the scm-bisect algorithm and git-branchless-submit for code review platforms. Significant effort was also dedicated to expanding integration test coverage across these new components to ensure stability and correctness.
Features
Added Apache 2.0 and MIT license files to published crates
The git-branchless-hook, git-branchless-init, git-branchless-invoke, git-branchless-move, and git-branchless-navigation crates now include LICENSE-APACHE and LICENSE-MIT files. This ensures that the terms of the Apache License 2.0 and the MIT License are explicitly distributed with each published crate, clarifying the licensing terms for users and redistributors.
(repo-wide) · high confidence
Automated demo recording infrastructure
Added helper scripts and Tcl/Expect configurations to the demos directory, enabling the automated recording of terminal sessions using asciinema. This infrastructure standardizes how demos are captured, allowing for consistent playback and optional uploading of the resulting casts.
demos · high confidence
Initial release of git-branchless CLI
The git-branchless command-line tool is now available, providing a workflow for managing Git commits without relying on traditional branch names. This is particularly useful for users who frequently switch between tasks, perform speculative work, or need to track changes that haven't been committed yet. The application is structured as a Rust library with a main entry point that delegates to a commands module.
git-branchless/src · high confidence
Introduce \`git-branchless-submit\` with GitHub and Phabricator support
A new \git-branchless-submit\ module and CLI command have been added to push commits to remote code-review platforms. This release introduces a generic \Forge\ trait and concrete implementations for GitHub (using the \gh\ CLI) and Phabricator (using the \arc\ CLI), allowing users to submit patch stacks for review. The feature includes support for multiple revision sets, parallel submission via \--jobs\, dry-run testing, and automatic branch creation. A diagnostic example tool is also provided to dump Phabricator dependencies.
git-branchless-submit/src · high confidence
Introduce dedicated git-branchless-init binary for repository setup
The repository setup logic (installing Git hooks, aliases, and man pages) is now executed via a new \git-branchless-init\ binary. This change extracts the initialization functionality into its own crate, allowing the init process to be invoked as a distinct subcommand rather than being embedded within the main \git-branchless\ binary. Users will interact with this via the \git branchless init\ command, which handles the installation of hooks and configuration specific to the current repository.
git-branchless-init/src · high confidence
Introduce reusable bisect search algorithm with example and testing utilities
The \scm-bisect\ crate now provides a reusable algorithm for identifying the first bad commit in a directed acyclic graph, similar to \git-bisect\. This release introduces the core \search\ module defining the \Graph\ and \Strategy\ traits, along with a \basic\ module offering common strategies like linear and binary search for source control graphs. An interactive guessing game example demonstrates how to implement these traits for a simple range search, and a new \testing\ module provides utilities like \UsizeGraph\ and \TestGraph\ to facilitate property-based testing of bisect strategies.
scm-bisect/src · high confidence
New TUI infrastructure and testing helpers for git-branchless-undo
The \git-branchless-undo\ crate now includes a new \tui\ module that provides the core infrastructure for an interactive terminal interface. This includes a \with\_siv\ function to initialize the Cursive runner with a custom theme (removing shadows and using terminal defaults) and a \SingletonView\ trait with a \declare\_views!\ macro to manage named UI views. Additionally, a \testing\ module is introduced, featuring a \CursiveTestingBackend\ that simulates terminal output and event polling, allowing tests to capture screenshots of the UI for snapshot assertions.
git-branchless-undo/src/tui · high confidence
New \`git-branchless-invoke\` crate for isolated subcommand execution
A new \git-branchless-invoke\ library crate has been introduced to handle the invocation of \git-branchless\ subcommands. This change enables developers to build and test individual subcommands in isolation, improving iteration times. The crate provides shared command context, argument parsing via Clap, and integrated tracing/logging infrastructure, including support for Chrome tracing profiles and libgit2 trace integration.
git-branchless-invoke/src · high confidence
New git-branchless commands: amend, hide, repair, restack, snapshot, split, and sync
This release introduces several new commands to the git-branchless workflow. The \amend\ command allows amending the current commit with staged or unstaged changes and automatically restacks descendants. The \hide\ command lets users explicitly obsolete commits and optionally delete associated branches. The \repair\ command detects and fixes broken commits and branches by marking them obsolete. The \restack\ command rebases abandoned commits onto their new parents. The \snapshot\ command creates and restores working copy snapshots for debugging. The \split\ command extracts changes from a commit into separate commits with various modes (detach, discard, insert before/after). The \sync\ command pulls from the remote main branch and restacks local commit stacks on top of it.
git-branchless/src/commands · high confidence
New undo feature with interactive TUI
A new \git-branchless-undo\ crate has been introduced, providing the ability to revert a repository to a previous state by inverting recent events. This feature includes an interactive terminal user interface (TUI) built with \cursive\_core\, allowing users to review and confirm actions such as undoing commits, hiding/unhiding commits, and reversing checkouts via a smartlog view.
git-branchless-undo/src · high confidence
Project initialization and repository configuration
The repository is initialized with essential configuration files: an \.editorconfig\ for consistent code formatting, \.gitattributes\ to manage binary and merge behavior for lock files and changelogs, a \.gitpod.yml\ for cloud-based development environments, and a \rust-toolchain.toml\ specifying Rust 1.86 as the toolchain. The project also adds a \CHANGELOG.md\ following Keep a Changelog standards, a \CODE\_OF\_CONDUCT.md\, a \CONTRIBUTING.md\ guide, and dual Apache/MIT license files. Additionally, Nix flake definitions (\flake.nix\, \flake.lock\) are added to support packaging and development shells, while the legacy Python implementation (\branchless.py\) and its tests are removed.
(repo-wide) · high confidence
Architecture
Extract Git hook logic into a dedicated \`git-branchless-hook\` crate
The Git hook implementations (post-checkout, post-commit, post-merge, post-applypatch) and their supporting utilities have been moved from the main library into a new, standalone \git-branchless-hook\ crate. This crate exposes a binary entry point that invokes the hook commands, separating hook-specific code from the core library and establishing a dedicated location for hook-related logic.
git-branchless-hook/src · high confidence
Extract \`git-branchless-record\` into a standalone crate
The \git record\ functionality has been extracted from the main \git-branchless\ binary into a new, standalone \git-branchless-record\ crate. This change introduces a dedicated library (\lib.rs\) and binary entry point (\main.rs\) for the record command, improving modularity and allowing the record feature to be built and maintained independently.
git-branchless-record/src · high confidence
Extract command-line options into a dedicated \`git-branchless-opts\` crate
The command-line argument definitions for \git-branchless\ have been extracted from the main binary into a new, standalone library crate (\git-branchless-opts\). This structural change centralizes the parsing logic for subcommands such as \move\, \switch\, and \traverse\, making the options available as a reusable library component for other parts of the toolchain or external binaries.
git-branchless-opts/src · high confidence
Extract core library module from git-branchless-lib
The \git-branchless-lib\ crate has been restructured to extract a new \core\ module, consolidating foundational components such as commit graph management (DAG), event logging, configuration, effects/progress handling, and checkout logic into dedicated source files. This refactoring organizes the internal architecture without changing external behavior, providing a cleaner separation of concerns for the library's core algorithms and data structures.
git-branchless-lib/src/core · high confidence
Extract git-branchless-lib crate with testing utilities and exit code handling
The repository structure has been refactored to extract a new \git-branchless-lib\ crate, which now houses core functionality, utility functions, and testing infrastructure. This change introduces a dedicated \testing\ module containing the \Git\ wrapper and snapshot helpers previously scattered in the main crate, allowing unit tests to access these utilities. Additionally, the library defines a new \ExitCode\ type and the \EyreExitOr\ helper type to standardize how subcommand exit codes are propagated alongside standard errors, replacing the previous reliance on generic \eyre::Error\ for exit status handling.
git-branchless-lib/src · high confidence
Extract git-branchless-navigation crate
The \git-branchless-navigation\ module has been extracted into its own crate, providing convenience commands to help users move through a stack of commits. This new crate exposes the \next\ and \prev\ traversal logic, including support for traversing by commit count or branches, and handles disambiguation when multiple children exist (newest, oldest, or interactive selection). It also includes an interactive commit selection prompt (using \skim\ on Unix) to assist users in choosing a target commit when navigation is ambiguous.
git-branchless-navigation/src · high confidence
Extract smartlog into a standalone binary crate
The smartlog functionality has been extracted from the main library into a new, standalone \git-branchless-smartlog\ crate, exposing a dedicated binary entry point (\main.rs\) that invokes the smartlog command. This structural change isolates the smartlog logic (defined in the new \lib.rs\) from the rest of the application, allowing it to be built and invoked independently.
git-branchless-smartlog/src · high confidence
Extracted move logic into a standalone \`git-branchless-move\` crate
The commit history and diff show the extraction of the \git-branchless-move\ functionality into its own crate (\git-branchless-move/src/lib.rs\). This refactoring isolates the core logic for moving commits and subtrees, including the \r\#move\ function, base commit resolution, and integration with the DAG (Directed Acyclic Graph) for commit analysis. The change also includes updates to build configurations, such as setting clippy warnings, upgrading the \esl01-dag\ dependency, and migrating to \sapling-dag\, alongside MSRV updates to Rust 1.82. Users benefit from a cleaner separation of concerns, potentially improving maintainability and allowing the move functionality to be used or tested more independently.
git-branchless-move/src · high confidence
Extracted revset parser and evaluator into a standalone crate
The revset parsing and evaluation logic has been extracted from the main library into a new, standalone \git-branchless-revset\ crate. This change introduces a dedicated grammar (via LALRPOP) and a full set of built-in functions (such as \siblings\, \merges\, and \tests.\*\) to the revset language, providing a cleaner separation of concerns for the commit-set query engine.
git-branchless-revset/src · high confidence
Extracted reword functionality into a standalone crate with a vendored editor
The \git-branchless-reword\ crate has been extracted from the main library into its own package, containing the core logic for updating commit messages and restacking descendants. This change includes a new vendored copy of the \dialoguer::edit\ module (\dialoguer\_edit.rs\) to allow customization of editor invocation behavior and bug fixes independent of upstream release schedules. The crate now exposes public APIs for editing commit messages and handling reword operations, including support for fixup commits and template-based message initialization.
git-branchless-reword/src · high confidence
Extracted test execution logic into a dedicated \`git-branchless-test\` crate
The test-running functionality has been extracted from the main library into a new, standalone \git-branchless-test\ crate. This change introduces a new \lib.rs\ that defines the core test execution engine, including support for parallel job workers, caching, and various execution strategies (such as bisecting and dry-runs), alongside a \main.rs\ entry point to expose these capabilities as a \git test\ subcommand. This modularization separates the test harness implementation from the core branchless logic.
git-branchless-test/src · high confidence
Introduce dedicated \`git-branchless-query\` crate for the query command
The \query\ command logic has been extracted from the main library into a new, standalone \git-branchless-query\ crate. This new crate exposes a \command\_main\ entry point and a binary wrapper, isolating the query functionality (including revset resolution, commit sorting, and branch/raw output formatting) from the core library. This structural change prepares the codebase for modular command handling without altering the user-facing behavior of the query command itself.
git-branchless-query/src · high confidence
Refactored Git library into modular submodules
The \git-branchless-lib\ Git interface has been reorganized from a monolithic structure into distinct, focused modules (\config\, \diff\, \index\, \object\, \oid\, \reference\, \repo\, \run\, \snapshot\, \status\). This change introduces dedicated types for Git configuration access, index stage management, and working copy snapshots, while centralizing Git subprocess execution and OID handling. Users benefit from a cleaner internal architecture that supports more robust handling of merge conflicts, staged/unstaged changes, and repository metadata without altering external command-line behavior.
git-branchless-lib/src/git · high confidence
Rewrite logic extracted into a dedicated core module
The commit-graph editing capabilities (rebase, amend, move) have been reorganized into a new \git-branchless-lib/src/core/rewrite\ module. This change introduces a structured \RebasePlan\ with explicit commands (such as \Pick\, \Merge\, and \Replace\) to define rewrite operations, and separates the planning logic from the execution logic. The execution layer now handles branch movement, HEAD checkout updates, and Git hook integration (like \post-rewrite\) through dedicated functions, providing a more robust and testable foundation for commit rewriting.
git-branchless-lib/src/core/rewrite · high confidence
Test coverage
Added benchmark suite for git-branchless-lib; Added integration tests for git-branchless-hook behavior; Added integration tests for smartlog rendering; Added integration tests for the git-branchless-submit module; Added integration tests for the record command; Added regression testing binaries for git-branchless-lib; Added tests for event log, git execution, tree hydration, and rebase planning; Added tests for the \git test run\ command; Added tests for the git-branchless-query crate; Expanded test coverage for core git-branchless commands.
Dependencies
Upgrade to Rust 2024 edition and MSRV 1.86 with dependency updates
The project has migrated to the Rust 2024 edition and raised the Minimum Supported Rust Version (MSRV) to 1.86. This change includes a comprehensive update of workspace dependencies, such as \clap\ to 4.6.1, \git2\ to 0.20.4, and \rusqlite\ to 0.39.0, while removing legacy Python development requirements (\requirements.txt\, \requirements-dev.txt\) in favor of the Rust-based tooling.
(dependencies) · high confidence
Housekeeping
Add Apache 2.0 and MIT license files to git-branchless-revset crate; Add license and documentation files to scm-bisect; Add license files and README to git-branchless-lib.
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 68 → 69 (+0.8)
- Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 80 → 80 (-0.3)
- Architecture 99 → 97 (-2.6)
- Maturity 62 → 62 (+0.2)
- Readiness 85 → 76 (-9.5)
- Security 60 → 66 (+5.6)
- Domain Modelling 100 → 100 (+0.0)
- Performance 91 (new)
Resolved (7)
- Documentation: no contributor guidance (README.md)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Hotspot: git-branchless-lib/src/core/rewrite/plan.rs (git-branchless-lib/src/core/rewrite/plan.rs)
- Hotspot: git-branchless-record/src/lib.rs (git-branchless-record/src/lib.rs)
- Hotspot: git-branchless/src/commands/amend.rs (git-branchless/src/commands/amend.rs)
- Hotspot: git-branchless/src/commands/split.rs (git-branchless/src/commands/split.rs)
New (15)
- End-of-life runtime: Rust 1.86
- Inconsistent cloning method naming. Repo uses try_clone while Dag also uses try_clone. However, in Rust, try_clone is often associated with file handles or streams, whereas clone or duplicate might be more semantically appropriate for graph structures. More importantly, if Repo and Dag are both core entities, they should ideally share a consistent trait or naming convention for duplication (e.g., both clone or both duplicate).
- Inconsistent entry point naming and signature. The main entry point for the core library is named main, while hook and init modules use command_main. Furthermore, main takes no arguments in the signature provided, whereas command_main variants explicitly accept CommandContext and specific Args types, suggesting a lack of unified command dispatching interface.
- Inconsistent method placement and return type for 'get only parent'. Commit has a method get_only_parent_oid that returns NonZeroOid directly (implying it panics or guarantees existence), while Dag has get_only_parent_oid that returns Result. This creates confusion about whether the operation can fail and where the responsibility for validation lies.
- Inverted test pyramid
- Off the main sequence: git-branchless-invoke
- Off the main sequence: git-branchless-lib
- Off the main sequence: git-branchless-opts
- Outdated: indexmap
- Outdated: thiserror
- Projects may be oversized for their cohesion
- Redundant and confusingly named methods. find_commit and find_commit_or_fail both return Result. The distinction between them is not clear from the signature alone (likely one returns Option inside the Result or panics, but the signature says Result for both). This suggests a lack of clarity on error handling strategy.
- Same redundancy as find_commit and find_blob. find_tree and find_tree_or_fail have identical signatures but different names.
- Same redundancy as find_commit. find_blob and find_blob_or_fail have identical signatures (Result) but different names, implying different error handling behaviors that are not visible in the signature.
- Unstable project git-branchless-submit
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
arxanas/git-branchless 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 30 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 03d6ab8dc1a2ff8a2bc44709b93ea6a9038147eb — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-cb25ca4feafa.