68 issue fixes · 27 other changes
v0.5.28 is mostly merge, push and ref-correctness fixes, custom object-store durability, and large speedups for log, diff, reset, fsck and rm on big repos.
This aligns Grit’s three-way merge hunk placement with Git when one side deletes a repeated tail boundary and the other inserts beside it. The review follow-up preserves exact byte identity for non-UTF-8 text while retaining indentation scoring, preventing the false conflict introduced in round one.
Authenticated push identity now reaches serve-side hooks, and embedders can carry in-process hooks and cancellation through protocol/HTTP sessions while receiving typed upload/receive outcomes. The round-2 commit makes advisory post-receive and post-update callback failures observable without undoing already-applied refs or rewriting the successful client response.
Plain `revs` and `log` walks now emit commit batches as the walker produces them instead of retaining the entire result before rendering. The library exposes a stream for eligible multi-token walks, while the CLI incrementally renders human, Markdown, and JSON output and preserves collected fallbacks for operations that require whole-walk state.
Malformed reachable commit parent headers no longer panic fsck. Connectivity fallback parsing now uses the existing bounds-checked commit tree/parent parser, and regressions cover truncated and invalid parent lines across reachable, unreachable, loose, and packed objects.
Custom-primary ODB writes now go directly to the idempotent backend instead of probing the primary and every read source first. The library adds explicit flush/rollback durability barriers around pack ingest and commit publication, while the SQLite example batches writes transactionally and correctly persists or discards them.
Push output now derives every successful line from that result's source ref, so multi-ref, followed-tag, `--tags`, and renamed-destination pushes identify the ref actually sent. Followed tags also make the JSON summary multi-ref, while rejected rewrites receive an actionable force-with-lease hint and strictly remote-ahead branches retain the pull-first hint.
This replaces `similar`-based merge alignment with Git-compatible xdiff compaction so repeated-line edits no longer produce a false content conflict. Round 3 removes byte-key copies and shares interning across the two default-Myers side diffs, recovering a material portion of the performance cost while preserving byte-accurate histogram and patience behavior.
Literal bundle fetches without a refspec now resolve the implicit HEAD request before object ingestion. Headless incremental bundles fail cleanly instead of writing dangling objects and falsely reporting that nothing changed, while explicit refspec fetches continue to update their requested destination.
This change makes checkout-family operations honor core.symlinks on Windows: enabled repositories create actual links, while disabled repositories retain Git-for-Windows-style placeholder files. It centralizes symlink creation and preserves the target byte length in refreshed index entries so a clean checkout does not immediately report a type or content change.
This change prevents rebase and conflicted merge/replay operations from writing transient empty blobs, empty trees, conflict-marker blobs, and materialized checkout trees into the real object database. It keeps genuinely referenced stage-0 auto-merge blobs durable while confining checkout-only objects to an in-memory ODB overlay.
Adds library and CLI support for following one file's history across renames, with typed validation and Git-compatible rename detection. Round five removes heuristic basename/hyphen path guessing and revises merge lineage selection, but the merge revision currently drops valid history in the real git/git acceptance case.
Adds a heap-free first-parent scan before the general ancestry paint walk and generation-based pruning when both commits are covered by a commit-graph. It also fixes the round-1 equality-boundary regression and adds focused regression/performance-shape tests.
This change makes `grit mv file dir/` behave like `grit mv file dir` when the destination is an existing directory. It also preserves trailing-separator intent for missing destinations, introduces a typed refusal for file-to-missing-directory moves, and improves move errors and CLI hints.
The wholesale switch guard now checks every added-path prefix with non-following metadata and stops when it reaches a symlink. A tracked symlink is accepted and replaced by the target directory tree; an untracked symlink is reported at the link path rather than exposing files reached through its target.
Pull overwrite refusals now retain their typed library error through CLI presentation. Users see the blocking paths and commit/stash guidance, while JSON and Markdown receive the same structured data as merge and switch.
Diff and stash worktree scans can now skip permission-denied tracked paths with a path-bearing warning while continuing over readable changes. Path-limited scans are pre-expanded correctly, including tree-only staged deletions selected by attribute, directory, mode-aware, and exclude pathspecs.
This change removes multiple whole-document conversions from filtered JSON output. Command outcomes are serialized once, released before jaq parsing, validated for strict JSON representability, and written directly to buffered stdout while preserving the one-JSON-value contract.
Garbage collection now treats every non-bare worktree index as an object-reachability root, so staged content in linked worktrees cannot be pruned from the shared object database. Resolve-undo entries root only regular-file blobs, avoiding attempts to resolve submodule commit IDs in the superproject ODB.
This makes repository-aware attribute pathspecs work consistently in restore, stash push, and rm --cached, including attributes that depend on the real Git object mode. It also recognizes long magic pathspecs in log/revs without requiring `--`, with compatibility tests and command documentation.
Adds stable JSON `kind` values and structured hints for common CI failures across repository discovery, commit identity/message validation, tags, paused operations, pathspecs, stash lookup, and missing blame paths. The round-2 fix restores all session-cancellation tests to the default grit-lib suite and hardens the test classifier against the `start` helper-name false positive.
This change prevents bulk and chunked checkouts from losing index entries or attempting descendant deletions after a directory has already become a file. It also corrects large-transition untracked-collision handling so switch, fast-forward merge, and hard reset can safely process directory-to-file and symlink-to-file replacements.
This change prevents terminal `grit log` output from disappearing when the default or configured pager executable is unavailable. It preflights plain pager commands and falls back to direct terminal output, while preserving shell execution for pipelines, redirections, environment assignments, expansions, and Windows command paths.
Adds process-level ownership for shared resumable bundle cache entries. A clone or checkout that cannot claim the shared cache lock downloads and consumes a uniquely named private bundle instead, preventing peers from corrupting or deleting the shared `.bundle`, `.part`, and `.json` files.
Safe maintenance root collection now protects staged objects from the main index, every linked-worktree index, and an explicitly selected GIT_INDEX_FILE. The refs-only root helper becomes internal, while docs and callers direct embedders to the repository-aware maintenance API.
History rewrites and amend operations now preserve configured Git notes on replacement commits. Configuration is preflighted before history movement, and notes refs use compare-and-swap against the snapshot tip so concurrent writers cannot be silently overwritten.
This change removes repeated pack-directory and loose-object probes during alternate ODB misses while preserving external object visibility. Repository fsck now validates objects in alternates, counts them, and reports only dangling roots instead of the full unreachable closure.
This change replaces repeated full-index scans during `rm` selection with sorted range queries for literal paths and one prepared matcher pass for non-literals. It also batches index-extension invalidation and empty-parent cleanup, while the round-2 commit restores canonical Unicode matching for precomposed pathspecs.
This change prunes stored-tree diffs by pathspec before rename detection and indexes exact rename candidates by object ID instead of comparing every delete with every add. It preserves attribute-aware pathspec behavior and Git’s one-sided rename semantics while substantially reducing work for narrow diffs.
Reverse-index publication now opens the pack, seeks to its trailing object hash, and reads only 20 or 32 bytes instead of loading the whole pack into a Vec. The round-5 cleanup also leaves no production RSS instrumentation or direct instrumentation environment/stderr hooks.
Adds a grit-lib basename-driven rename phase before renameLimit, typed skip notices propagated through public diff APIs, and a thin CLI stderr notice. Round 3 tries to recover performance by bypassing the basename phase for globally unique basenames and expands duplicate-basename benchmarks.
This changes reverse-index sidecar generation to seek directly to the pack checksum trailer instead of reading the whole pack into memory. It also provides a clean replacement commit whose metadata and message satisfy the integration contract.
This change adds a basename similarity pre-pass before the inexact rename-limit check, allowing large commit-to-commit diffs to retain inexact renames that Git recognizes. It propagates a typed skipped-detection notice through the library and thin CLI outputs, shares rename blob data, and covers the behavior with Git-oracle and CLI regressions.
Move/copy blame now processes each current file range once even when several tracked final lines map to the same current index. This restores the one-result-per-file-line invariant without discarding legitimate shared parent attribution.
Push now recognizes `.`/`..`, `./…`, `../…`, and existing local Git directories as literal destinations instead of configured-remote names. This makes relative local pushes consistent with fetch, pull, clone, and system Git while leaving ordinary lone branch/refspec tokens unchanged.
Clean directory mode now asks the sorted index whether a directory has tracked descendants and uses an exact binary lookup for stage-0 gitlinks. This removes the index-wide scan repeated for every worktree directory without changing CLI behavior or formats.
Plain pushes can no longer move a remote tag merely because its peeled commit is a descendant or unchanged. Existing changed tags are rejected with a stable `tag_exists` result unless `--force` is explicit, while new tags, identical tags, deletes, branches, and forced tag updates retain their intended behavior.
FilesRefStore now refreshes compare-and-swap state after acquiring prepare locks and appends each update’s reflog only after its commit-time recheck succeeds. The round-3 correction ensures symbolic log-only updates lock every reflog destination, including the peeled branch whose reflog receives a mirrored entry.
Tree-level three-way merges now default content alignment to histogram, matching Git's ort behavior for merge, pick, restore, stash, and rerere paths while preserving Myers semantics for the standalone merge-file API. The round-2 follow-up makes the system-Git compatibility regression use the visible test helper exports and the correct repository path type.
This change makes grit’s three-way file merge recognize merge-ort’s repeated-anchor EOF overlap cases, preventing picks from silently appending changes after a tail deleted on the target branch. The round-3 adjustment narrows that heuristic to repeats inside the actual one-sided tail cluster, preserving clean merges when the only earlier matching anchor lies outside the changed region.
This change makes rename-following revwalks avoid repeated tree scans and duplicate rename work. It uses changed-path Bloom filters for unchanged commits, cached literal-path tree lookups for existence checks, and carries each selected parent's next follow path out of the decision step so callers do not recompute it.
When `--follow` starts at a commit where the requested old path is already gone, the revwalk now continues through parents with that same path instead of stopping immediately. It therefore reaches and emits the rename/delete commit and earlier history while still returning an empty list for a path that never existed.
This change makes `rebase --exec` stop resumably on an initial replay conflict and persists exec recovery state through continue, skip, and abort. Round three narrows untracked cleanup so normal abort and successful continue preserve user files, but failed-command recovery still uses a stale baseline and can delete post-stop user files.
Object reads now preserve actionable corruption context instead of exposing bare zlib or EOF failures. Loose failures identify the object and file; packed failures identify the object, pack and offset; repository resolution and the CLI retain that typed detail, while composite stores can still recover from another healthy copy.
This replaces repeated delete×add scans in basename rename preflight with hash-set membership checks and updates only the directory guess whose count changed. It adds regression coverage for repeated, disjoint basenames and a Criterion workload matching that shape.
This change replaces eager range-hide painting for dense path-limited revision walks with an incremental generation-ordered hide cursor. The round-3 correction keeps deferred lower-generation frontier nodes available, preventing excluded shared roots from reappearing in later merge-parent queries.
Adds cooperative interruption to add, mv, and rm so handled SIGINT/SIGTERM/SIGHUP exits through cancellation and releases index locks. The round-3 repair makes rm transactional across partial worktree deletion failures by restoring all already-removed paths and reporting incomplete rollback precisely.
Cone sparse switch and hard reset now preserve opaque excluded subtrees instead of recursively flattening them. Added excluded trees are represented as canonical `040000` skip-worktree rows ending in `/`, so both Grit and system Git can read and round-trip the sparse index.
Exec-enabled rebases now stop resumably on replay conflicts and preserve their operation state through continue/skip/abort flows. Failed exec rollback is scoped to files created by the current command, so untracked files created by the user while a rebase is stopped are no longer silently deleted.
Hard-reset checkout coalesces wholly added or removed subtrees so large tree transitions avoid materializing a leaf-level diff for every changed file. The follow-up test now makes a real system-Git compatibility comparison for nested untracked files instead of comparing grit status to a second copy of itself.
Overlay-generated merge objects now persist through the repository's configured primary object store. Custom writable primaries receive direct writes and a batch flush, while files-backed repositories continue using loose-object writes.
When a followed path is absent from both the starting commit and its parent, the revwalk now keeps that path active and continues into older history. Hidden absent-path commits remain hidden, while the later rename/deletion boundary and earlier path history are returned.
Custom object-store repositories can now complete clean non-fast-forward merges, cherry-picks, and reverts instead of failing when their in-memory merge overlay is flushed. Files-backed repositories retain the existing loose-object persistence path, and no public API or object format changes.
Adds a single durability barrier for custom buffered object stores and invokes it before refs or the index can expose newly written objects. Flush failures now roll back staged objects, including commit and pack-ingest paths, and rebase --exec no longer moves detached HEAD before its rewritten objects are durable.
Non-bottom reftable compaction now carries forward deletion tombstones so older tables cannot make deleted branches or tags reappear. Bottom-inclusive compaction still drops tombstones because no older table remains to shadow, preserving compact output.
Object writes to a batched custom primary are now made durable before Grit writes an index or moves refs that name those objects. A private ODB helper centralizes flush-and-rollback behavior, and all affected staging, tag, notes, history, rebase, exec, commit, and ingest paths use it.
This corrects upload-pack’s shallow-boundary classification for multi-tip re-shallowing and for repositories that are themselves shallow. Clients now receive only valid `shallow`/`unshallow` transitions, and traversal stops at server-side graft boundaries even though the underlying commit objects still contain parent lines.
Local-path and file:// transfers into custom object-store primaries avoid per-object existence round trips. Fresh stores write the reachable set directly; incremental transfers batch candidate checks, including tag-object and peeled-target validation, while retaining the existing optimized files-primary path.
Reworks histogram diff indexing and traversal so repeated-line files no longer retain full-file occurrence maps through recursive regions or repeatedly hash and scan the same lines. It adds deterministic work bounds plus system-Git numstat oracles for repeated `.po`-style content.
Connectivity-only fsck now builds a header-only object kind map and walks only commit/tree/tag payloads, marking valid blobs reachable without inflating them. The round-2 correction preserves reachable blobs in dangling analysis, including blobs reached through trees and annotated tags.
Repository handles with a real work tree now report non-bare even when their common repository has core.bare=true. Worktree enumeration separately preserves Git's convention of marking the main row bare when core.bare is enabled.
Updates external grit-lib integration tests to construct non-exhaustive request/options types through their supported constructors and then assign public fields. The round-2 repair restores option semantics and all compatibility tests that were accidentally dropped during the mechanical migration.
Ref transactions now remove the reflog belonging to a deleted ref on memory, files, and reftable stores. This also removes stale files-backend log paths that prevented a nested ref from being created later, while preserving a newly recreated reflog in same-batch dereference/delete flows.
This change lowers hard-reset memory by avoiding broad index/path materialization and by coalescing safe whole-subtree deletion work. Its round-two follow-up also makes the new public skip predicate compose correctly with restricted worktree diffs and adds focused coverage for that contract.
This change makes default human and Markdown author grouping use a single count-only library walk instead of repeatedly walking and loading full commits. It accelerates packed and deltified histories through bounded prefix reconstruction and pack-order parallel counting, while the round-2 fix preserves exact author identity semantics.
Makes unlimited default revwalks use the same ungated committer-date ordering as bounded walks and system Git. The round-2 correction keeps object-filtered walks on the full engine, preventing the new fast path from bypassing sparse-filter parsing and validation.
Push planning now snapshots local heads and tags once, indexes full and short names, and reuses known names/OIDs while resolving every requested refspec. This changes only grit-lib planning internals and adds focused regression and Criterion coverage; transport, CLI, public APIs, and repository formats are unchanged.
Adds a typed nearest-tag description API to `grit-lib` and exposes it through a thin `grit describe` command with human, JSON, and Markdown output. It peels nested tags, skips non-commit tags, filters reachability in one walk, and reports the minimum exact `tag..commit` count with stable tie-breaking.
Refreshes the checked-in grit-lib public API surface after already-landed API additions and makes one CLI rustdoc link fully qualified. This is a mechanical CI repair with no executable behavior or Git format/protocol changes.
This branch contains no changes relative to origin/main. It confirms that the previously failing rustdoc link and stale public API snapshot were already corrected on main at the exact SHA under review.
Diff target selection now lives behind grit-lib APIs that return pathspec- and status-filtered DiffEntry rows for every DiffTarget and load opposite-side peer changes for stable hunk IDs. The CLI calls those APIs and drops its duplicate staged, unstaged, worktree, commit/range, path-filter and peer-selection helpers; --diff-filter now consistently applies to all diff modes.
Adds one fixed-width, seven-hex-digit display form to `grit-lib` and routes object-id labels throughout the library, CLI, and HTTP server through it. It removes ten named helper copies and numerous inline truncations without changing repository data, protocols, or observed output.
This rewrites v0/v1 smart-HTTP fetch negotiation so each stateless POST is a complete request, while the negotiator owns replay state and stops on server readiness. Shallow/deepen fetches now offer local haves, request `deepen-relative` only as a capability, and use `no-done` to avoid a final HTTP round trip.
Refreshes the committed grit-lib API snapshot so it records the already-landed revwalk follow-history surface. This is generated metadata only and does not alter runtime behavior.
Removes repository-discovery writers for GIT_TRACE_SETUP and GIT_TRACE2_PERF that existed only for the deleted upstream shell harness. It also removes a dead GRIT_DEBUG_SAFE_DIR field and replaces trace-file line-coverage assertions with direct assertions about discovered git directories, worktrees, and bare state.
This review branch contains no changes: its tip is identical to origin/main. The public-api failure it was assigned to fix had already been resolved on main by refreshing the generated snapshot, so this review validates the existing fix rather than proposing another patch.
This removes repeated work from streamed log listings and filtered packed-ref decoration scans, batches each JSON row into one write, and regenerates hot-text layouts from both release and dist profiles. The result is byte-identical log JSON with substantially lower target latency and resident memory.
Keeps small tree/commit diffs on the caller thread and starts DiffContent workers at 16 changed entries by default. The same helper governs structured show/diff output, streaming structured diffs, and stat computation, while `ThreadPolicy::min_items_override` remains available to move the threshold.
Refreshes the committed grit-lib public API snapshot to match the API generated by the pinned cargo-public-api toolchain. There is no Rust behavior, API implementation, test, CLI, on-disk format, or wire-protocol change.
Config boolean, integer, and color parsing now returns structured `ConfigValueError` variants, while keyed accessors attach the offending key through `ConfigError::InvalidValue`. Callers propagate those typed failures, and 23 redundant case-variant fallback lookups are removed because config keys are already canonicalized case-insensitively.
Reformats one function call in the worktree collision scan to rustfmt's canonical single-line layout. There is no semantic, API, on-disk format, wire protocol, test, or documentation change.
This change removes several accidental quadratic scans and redundant reads from status/add, worktree diff, hard reset, rebase planning, and reverse-index creation. It also batches attribute-blob fetching during large non-sparse checkouts, restoring blobless-reset correctness and substantially reducing clone/repack memory.
Reformats one private grit-lib diff import list into rustfmt's required single-line layout. There is no behavioral, API, format, protocol, test, or documentation change.
Refreshes grit-lib/public-api.txt to match the API currently exposed by origin/main. This is a generated snapshot-only correction; it does not alter library or CLI behavior.
Fetch ref updates now expose a coarse typed kind in grit-lib, and push outcomes answer whether they contain updates or rejections. The CLI consumes those APIs for human, JSON, and Markdown rendering, eliminating duplicate counts and a stringly typed push-rejection branch while preserving output contracts.
The landed commit synchronizes the checked-in grit-lib public API snapshot with the API already implemented on main, including the DiffEntriesResult return type and other accumulated surface changes. There is no remaining review-range delta because HEAD and origin/main are both 6f80f84f3.
Adds a bounded pack inflate path that reads whole packed commits only through the subject needed by one-line listings, while retaining full reads for deltas, loose/custom stores, JSON, decorations, and diff output. Human/Markdown `log` and `revs` streams opt into that extent; public API, tests, docs, benchmark baselines, and hot-text layout are updated together.
This removes redundant work and transient allocations from partial worktree restore and the shared line-diff/apply paths. Hunk restore now avoids unnecessary hashes/stat refreshes, unified diff lines use one compact record table, and blob patching borrows line slices instead of cloning them.
Removes 14 warning variants and 6 top-level error variants that no production path constructs, together with their CLI formatting and kind mappings. It also deletes several Git test-harness/environment branches that always evaluated to constants because they read `Environment::empty()`, consolidating index version selection while retaining the effective index, diff, protocol, cache-tree, and revwalk behavior.
Refreshes grit-lib's checked-in public API snapshot to match the library surface already present on main. It records the Cancelled error variant in generated sort order and the revwalk iterator types as non-Send/non-Sync, restoring the dedicated CI check without changing executable code.
This review branch contains no changes: it points at the same commit as current origin/main. The public API snapshot repair it was intended to carry had already landed on main through d3aab95fd, so integration would be a no-op.
This change reduces status startup residency by grouping hot functions by workload set, includes every alias of linker-merged functions, and deduplicates per-file attributes in the racy index scan. It refreshes the generated linker maps and records reproducible status benchmark reports and methodology.
Restores four local helpers used by the custom object database porcelain integration tests. This repairs the integration-test compile failure caused by an earlier conflict resolution without changing library or CLI behavior.
This change replaces the files-backend pack-refs HashMap rebuild with a single validated, borrowed merge of existing packed refs and sorted loose refs. It also avoids full object inflation for tag detection, reuses loaded config for lock waits, and takes the packed-refs lock before reading to prevent lost concurrent rewrites.
Refreshes the committed grit-lib API inventory so the pinned public-api generator recognizes IndexPathSkipPredicate in its current sorted location and trait-object spelling. This is generated metadata only; runtime code and behavior are unchanged.