72 issue fixes · 29 other changes
grit v0.5.29 fixes many correctness bugs (non-UTF-8 paths, shallow clones, case-insensitive filesystems, rerere), adds cancellation and HTTP timeouts, and speeds up describe, notes, merge and diff.
Creating a branch with `grit switch -c work origin/main` now records `origin/main` as its upstream and reports that relationship in human, JSON, and Markdown output. Users can force or suppress the behavior with `--track` and `--no-track`, while automatic mode follows the existing branch tracking configuration.
Filtered JSON command outcomes are now converted directly from serde data into jaq values, with repeated object keys sharing one allocation. Filter results are still written directly as compact JSON, and unfiltered JSON continues through serde_json unchanged.
Pushes from shallow clones now terminate object enumeration at local shallow boundaries instead of reading absent parents. Wire pushes announce those boundaries to receive-pack, while local-path pushes classify required shallow roots, honor `receive.shallowUpdate`, expose the temporary shallow file to hooks, and persist accepted boundaries.
On files-backed repositories that compare paths case-insensitively, ref creation now checks existing loose and packed names plus sibling creates under ASCII case folding. A colliding receive-pack create is refused before it can write a shadowing loose ref, and the wire status reports `reference already exists`.
Preserves user-managed skip-worktree entries through restore, stash, and reset so local-only files are not exposed, staged, overwritten, or deleted unexpectedly. The round-two follow-up closes the remaining cross-tree reset cases, including atomic refusal when deleting a dirty skipped file.
Makes hard-reset cancellation transactional when a whole tracked directory is removed as one coalesced checkout operation. It restores every tracked file and any dirty worktree bytes after cancellation without treating genuinely untracked nested files as rollback data.
Grit now participates in Git's shared rerere cache throughout merge, pick, revert, and rebase conflict workflows. It replays prior resolutions at conflict stops, records newly resolved postimages on commit/continue, clears abandoned state on abort, and reports rerere actions in structured and rendered CLI output.
Exposes blame, describe, tag-list, and worktree result models directly through the optional `serde-models` feature. It also makes commit outcome identity timestamps consistently RFC 3339, adds committer and full message data to `CommitOutcome`, and simplifies CLI commit rendering to consume those library fields.
This change gives receive.denyCurrentBranch=updateInstead its own typed policy and deploys accepted pushes into the checked-out worktree and index. It refuses dirty, unmerged, staged, hook-declined, and untracked-overwrite cases before moving the ref, while preserving warn/ignore behavior and handling linked worktrees.
History operations now consistently apply `refs/replace` while retaining the original displayed object IDs. The round-2 follow-up makes replacement discovery work through loose refs, packed-refs, and the repository's reftable backend, and fixes the remaining commit-diff path.
Untracked-cache scanning and staging now preserve non-UTF-8 path bytes end to end instead of opening a lossy replacement path. The round-3 correction recognizes reversible pathhex directory markers in raw-byte space, expands their contents, and prevents malformed empty-name trees.
Reftable readers no longer hold the process-global stack-table cache lock while reading `tables.list`, opening or memory-mapping table files, or retrying after compaction. A missing table now returns an error instead of recursively locking the same mutex and wedging every later reftable request in the process.
This change gives each pack store reusable thread-local read state so primary-to-alternate object lookups stop discarding pack hints on every object. It also avoids repeated loose probes for a known-empty primary, loads commit graphs from alternate object directories, and preserves external pack discovery after an empty-primary miss.
Adds bounded graceful shutdown to the HTTP service used by `grit serve`. The first shutdown signal closes the listener and drains active requests, a configurable grace period caps that drain, and a second signal terminates immediately.
Human and Markdown commit identifiers now honor core.abbrev and extend through collisions, so copied identifiers resolve to the displayed object instead of becoming ambiguous in large repositories. The round-two follow-up exposes the helper at the canonical commit API path and removes the Markdown page's per-row abbreviation setup.
Rebase apply rollback now records each old tree entry’s object ID and mode in its journal, then restores clean tracked paths through the existing batched parallel checkout writer. Cancellation is checked before ref publication, and all rebase-session apply paths expose cancellation through the documented Library(Cancelled) shape.
Commit operations now observe cancellation while pre-commit and commit-message hooks are running. Cancellation force-stops the hook child, becomes the typed top-level cancellation error, and lets index-lock guards clean up before the CLI exits; merge commit hooks use the same path.
This change replaces per-tag reachability counts with a single commit-graph-backed describe walk and reuses a stable within-bit when tagged commits are re-popped. The round-3 panic fix works, but the overall new walk becomes much slower than current main on the real repository this issue targets.
Binary diff-stat rows now preserve both side lengths and show them in human, Markdown, and JSON output. The round-2 follow-up completes the no-index path and regenerates every shared schema affected by the new fields.
Replaces candidate-by-candidate history work in describe with one collected target-history walk and batched tag-cone propagation, while retaining exact Git-compatible commit distances. The final follow-up derives candidate eligibility from that same reachability set, including first-parent semantics, instead of performing separate ancestry walks per tag.
This change makes HTTP discovery and stateless upload-pack waits cancellation-aware by running blocking client calls on workers and polling cancellation on the owner thread. It also adds receive timeouts/low-speed handling, CLI signal coverage, and stalled-server library regressions.
Symlink worktree entries are now rejected before embedded-repository resolution, so a link to `.` or another repository is treated as an ordinary symlink. Add outcomes also report an embedded gitlink only when classification or the resulting index entry actually says mode 160000.
This fixes a silent data-resurrection bug in three-way merges. When the incoming side renames a file that the current side deleted, grit now retains Git-compatible stage 1 and 3 entries at the new path and stops merge/replay operations as conflicted instead of committing the renamed file as clean.
Replaces the stale-key/re-pop describe traversal with a reachable-DAG settlement that finalizes each commit once. Tags reached through multiple merge depths are retained, exact range-count distances are computed, and exponential merge-ladder reprocessing is eliminated.
Local clone sources are now resolved and validated against the caller’s working directory before grit claims or initializes the destination. A typo therefore returns the existing typed remote-unreadable error instead of manufacturing an empty repository that points to itself; bundles and genuine empty repositories continue through normal clone handling.
This change stops clean EOF appends from being turned into false conflicts when the other side has a large earlier deletion. It replaces a broad repeated-line suffix heuristic with a narrow, hunk-local anchor-slide check and updates regression coverage to distinguish Myers (`merge-file`) behavior from histogram/tree-merge behavior.
Makes smart-HTTP fetch and clone waits interruptible without retaining borrowed cancellation pointers. Discovery and POST work run on HTTP workers while the owner thread polls a scoped Cancel, and normal configured HTTP behavior remains available for slow servers.
Scheduled-delete membership during case-insensitive wholesale directory checks is now backed by an ASCII-folded hash set instead of scanning every deletion for every disk entry. Both reset’s checkout safety walk and switch’s worktree-guard walk use the same internal lookup, reducing the reported quadratic CPU cost to near system-Git wall time.
Describe now has two bounded strategies: a generation-ranked backward walk when a usable commit graph exists, and an exact fixpoint computation over the reachable subgraph when it does not. The fallback removes the per-candidate full-history distance loop that caused the round-2 regression while retaining exact winner and tie-break behavior.
Stash drop now returns and displays the removed stash commit id, making accidental drops recoverable. Stash apply, pop, branch, and show accept typed stash references so commit ids can be used where appropriate, with versioned JSON schemas and updated human/Markdown output.
`merge --check` now predicts the command actually requested when `-X ours` or `-X theirs` is present. Both attached and detached HEAD paths forward the already-built merge options, and a system-Git comparison locks in the resulting tree IDs.
This change makes empty-history commit-graphs internally consistent. The reader accepts a valid zero-entry graph already accepted by Git, while both filesystem writer entry points leave the graph untouched when there are no reachable commits; the CLI and docs describe the no-op clearly.
This change lets a clone preserve branch and tag names that differ only by ASCII case by writing the initial ref batch to packed-refs. Later fetches continue past colliding loose refs with a typed rejection and reftable guidance, while receive-pack remains strict and rejects a same-batch Foo/foo push without storing either ref.
Push and receive-pack now cooperate with SIGINT/SIGTERM/SIGHUP cancellation, including while deflating a large streamed blob, so interrupted local/SSH pushes drop their receive quarantine before refs can change. Garbage collection also recognizes aged abandoned receive quarantines, while the round-2 adjustment preserves upload-pack’s existing immediate first-signal termination behavior.
Streams pack index rows alongside locally built pack bytes, releases sender-side reachability/cache state before ingest, and installs non-thin packs without rescanning their bodies. Local copy and push delta-search windows now default to 32 MiB, with correctness and Linux RSS regression coverage added.
Grit now uses reflog-aware fork-point boundaries for implicit rebase and pull --rebase, so commits removed by a teammate’s force-push are not resurrected. It adds explicit fork-point controls, library APIs, Git-compatibility coverage, and matching documentation.
Interrupt-aware cancellation now covers worktree creation, history rewrites/rebase, cleanup, maintenance, bundles, checkout, and checkin while preserving rollback and lock cleanup guarantees. The round-3 correction makes bundle output transactional with respect to an existing destination: only the temporary file is removed on failure, and replacement occurs only after a successful write.
Replaces generated or copy-pasted rustdoc on public diff, command-runner, diagnostics, rerere, gitmodules, and commit-graph items with descriptions of actual semantics. It also explains which branch-list and file-diff APIs embedders should choose, documents rev resolution error behavior, updates the library guides, and adds a source-level regression guard.
Adds a small ConnectOptions constructor that selects Git protocol version while defaulting private cancellation state, then migrates all affected external integration tests to it. This restores nightly full-tests compilation without changing transport behavior or wire bytes.
Branch movement and its branch/HEAD reflog records now succeed or fail together through the established ref-store commit path. A reflog backend error is returned to the caller and leaves the branch tip unchanged instead of silently reporting a successful merge with missing history.
Dropping the final repository object store now removes that store's pack/index mappings from the dropping thread's live cache and saved snapshots. Weak lifetime tokens also prevent a dead store from being saved again when a thread switches cache contexts, while preserving the existing hot read path.
References::update now follows symbolic HEAD to the checked-out branch instead of detaching it, and repository-scoped ref updates create reflogs according to core.logAllRefUpdates. Callers also gain explicit direct-update and compare-and-swap APIs, while round two makes HEAD and branch reflog decisions independent when only one existing log should be preserved.
This change routes streamed diff bodies through a locked stdout writer that uses a 64 KiB buffer for pipes/files while leaving terminals immediate. It also writes the plain gutter directly and applies the same buffering policy to patch-text and no-index patch output, with regression coverage for batching and byte parity.
Fixes false untracked-overwrite refusals for case-only renames when a large delete set selects the wholesale scan. The guard resolves the filesystem’s actual spelling once through a per-scan cache, then checks that spelling against case-aware tracked and scheduled-delete lookups while retaining real collision detection.
This change preserves the direct typed serde-to-jaq JSON filter pipeline after the rejected bytes/reparse experiment and documents why that invariant matters. It adds a large diff-shaped unit test showing the direct conversion remains faster than serializing JSON bytes and parsing them back.
Adds a public FIFO gate for ref backends with a single in-process writer slot and threads lock-wait budgets through `RefStore::prepare_for`. Memory-backed and wrapped stores now serialize contending writers fairly, release admission on commit/abort/drop, and skip timed-out tickets so disjoint updates no longer starve.
Incremental bundle unbundle now validates all prerequisite commits before touching the pack. Missing prerequisites produce a typed library error carrying every `(oid, subject)` pair and a CLI error listing the object ids; the destination object database remains untouched.
Serving now reads HEAD and repository tips from the repository's injected RefStore when refs are not disk-backed. That restores v0 HEAD/symref and v2 ls-refs HEAD/symref-target advertisements and makes related upload/receive policy checks see memory-only refs.
Reference-transaction hook lines for log-only symbolic HEAD updates now resolve HEAD through its target ref, so subsequent commits report the real previous tip instead of an all-zero oid. The round-2 test parser correctly ignores the hook script's trailing delimiter, allowing the end-to-end regression to validate prepared and committed phases.
Makes clone’s bundle-uri discovery and smart-HTTP waits interruptible by moving blocking HTTP operations to workers polled by the caller. It also wires configured low-speed windows into those waits and adds library/CLI regressions for stalled clone cancellation, signals, delayed responses, and process-environment hygiene.
Receive-pack can now accept pushes into repositories backed by a custom writable object store and custom ref store. Incoming objects remain isolated in a memory overlay through validation and pre-receive, then are copied to the configured primary at the same publication point used by files quarantine migration.
Ref creation under core.ignorecase no longer loads every loose ref body. The replacement scans packed ref names and walks only relevant loose-ref directory components, including nested case-folded path collisions such as Foo/bar versus foo/baz; deletes avoid the create check entirely.
Switch now checks cancellation before taking the destructive path, during large tree-transition planning, and before each progressively sized wholesale-directory removal batch. A pre-set cancellation therefore exits before touching the worktree, while cancellation that arrives later still uses the existing journal rollback guarantees.
This change replaces repeated full-index scans during untracked-cache refresh with raw-byte indexed lookups. It handles sorted indexes through the existing index search and unsorted indexes through one precomputed sorted snapshot, preserving non-UTF-8 path correctness while restoring first-status performance.
This change replaces whole-notes-tree scans and rewrites for single-note reads, adds, previews, and removals with a path-local fanout walker and bottom-up tree splice. It keeps full scans for listing and falls back to the existing tree materializer for irregular layouts.
This change makes merge, pick, and revert exact-rename augmentation deduplicate known rename pairs with one exact-value HashSet lookup per candidate instead of scanning the complete pair vector repeatedly. It adds a repeated-basename directory-move compatibility test against system Git and a Criterion benchmark for the hot path.
Removes whole-request low-speed deadline behavior from PendingHttp waits and locks that behavior in with unit and real SmartHttpTransport discovery regressions. Healthy responses can now run longer than http.lowSpeedTime as long as the body reader observes sufficient throughput, while cancellation remains polled.
Notes add/remove use path-local tree splices so existing fanout trees no longer require materializing every note. This follow-up fixes the remaining boundary case by routing the 256th insertion from a 255-note flat root through the established fanout writer and locks it down with a Git-compatible regression.
This hardens index parsing so truncated entries and attacker-controlled entry counts cannot slice beyond input or request enormous Vec allocations. Corrupt files now return typed IndexError results, while valid Git-written EOIE/IEOT indexes continue to load.
Annotated tag message bodies no longer make a repository corrupt merely because they contain invalid UTF-8. Callers receive a lossy Unicode view, while serialization uses preserved raw bytes so tag object IDs and signatures remain unchanged.
Clean now resolves repository-relative storage strings back to raw work-tree paths before deletion, so non-UTF-8 files and directories shown by dry-run are actually removed by force mode. The round-2 correction preserves the safety boundary around nested repositories by testing cumulative path prefixes rather than isolated components.
This change makes staged restore classify all selected paths first and update the index in one batch. It retains unchanged entries and their stat data, preserves split-index positions on replacements, and records resolve-undo while dropping conflict stages exactly as the former sequential path did.
Adds a fast CLI integration test that creates and modifies 400 files, runs a two-commit JSON diff through `.files|length`, and verifies the filtered result is 400. It places coverage for the already-landed memory fix in the normal test suite instead of behind `full-tests`.
Bundle creation now stages output in a sibling `.bundle.part`, flushes it, and atomically replaces the destination only after successful pack generation. The handle gains cancellable/progress-aware and options-based creation APIs, missing objects become a typed bundle error, and the CLI calls the repository handle instead of lower-level bundle code.
Stash creation and restoration now retain raw non-UTF-8 path bytes instead of accidentally treating reversible storage strings as literal filenames. The round-2 addition makes untracked restore preflight atomic for non-UTF-8 file/directory collisions before any tracked worktree or index mutation.
Repository discovery and open now return typed config errors instead of collapsing malformed local, global, or included configuration into “not a repository.” The CLI unwraps those config errors through its context chain and renders the existing fatal config diagnostic; invalid core.bare values are now validated when repository setup reads that key.
HTTP low-speed limits now interrupt socket reads that receive no bytes, covering silent servers and servers that stall after response headers. Clone also stops immediately when its optional bundle-URI probe fails for low speed, avoiding a second full timeout window before normal discovery.
Repository paths carried as reversible storage strings are now decoded before filesystem and index access across switch, merge guards, restore, stash, checkout preview, and snapshot restoration. Human restore output is quoted appropriately, while machine-facing paths retain reversible encoding.
Shallow commits now behave as effective roots across revision navigation, commit diffs, patch/stat logs, pickaxe, and blame. Blame exposes root/boundary attribution consistently in human and stable JSON output, while grafts continue to override shallow metadata.
Preserves the index assume-unchanged bit through reset, merge, and stash when the resulting stage-0 entry still identifies the same path, mode, and object. If the blob or mode changes, the bit is dropped, matching system Git while leaving skip-worktree behavior unchanged.
This change makes case-only directory renames materialize the target spelling on case-insensitive filesystems during switch, fast-forward merge, pick, and restore. The round-three fix removes the restore planner's remaining Cartesian destination scan by building and reusing a folded hash lookup.
Early smart-HTTP and upload-routing errors now consume unread request bytes before completing the response, preventing reverse proxies from replacing useful 401/404/413 statuses with 502. Decode errors use a bridge between Hyper's async body and the blocking protocol reader so the remainder can be drained with a 15-second idle timeout and 1 GiB ceiling.
Refreshes the committed grit-lib public API snapshot to match three already-landed ref-store and receive-pack surface changes. It records one changed function signature, one new validation function, and one new refusal enum variant; runtime code is untouched.
There is no branch change to integrate. The author correctly detected that current main already contains the refreshed grit-lib public API snapshot and avoided creating a redundant commit.
Adds a reusable grit-lib view of how a GitButler workspace stands against its target, excluding the bookkeeping workspace commit and reporting each applied head's ahead count. Status now calls that API and only maps the typed result into output, with unchanged human/JSON/Markdown behavior.
Adds `ConfigSet::bool_or` for boolean settings that intentionally fall back on unset or malformed values, plus accessors for four heavily reused core booleans. About 70 readers across grit-lib and one CLI presentation helper now share that implementation, deleting three private helpers and duplicate case-variant lookups without changing behavior.
Commit preview now derives its file list directly from the index-to-parent-tree cache-tree walk instead of probing the ODB for every index row, rehashing staged worktree files, and flattening the full parent tree. It also fixes tracked non-UTF-8 staging paths and uses a byte-exact fallback so previews and real commits report the same stored path names.
This patch replaces one invalid public-to-private rustdoc link with prose and corrects two stale intra-doc references in the CLI and HTTP server. It restores the strict workspace rustdoc gate without changing executable code or public behavior.
There is no integration payload: the submitted branch is byte-for-byte identical to current origin/main at c4dba287f. The rustdoc repair had already landed through commit 524bddb27 and is green on main.
Shrinks grit-lib by removing APIs with no callers and confining test-only collection helpers to tests. It also removes an unread xdiff field/lifetime and an unused reftable wrapper, leaving production behavior unchanged.
Refreshes the committed grit-lib API inventory so it describes the API already shipped on main. The generated file now includes tree diff byte sizes and the expanded parallel diff-stat row, while normalizing field order.
Refreshes the committed grit-lib API snapshot so it records the two blob-size fields on structured tree diffs and the two added u64 values in parallel diff-stat rows. An equivalent commit has already landed on main, so the reviewed Mesh branch now has no unique diff.
This change teaches the hot-text profiler about ordinary small branch switches that use serial checkout writes, then deterministically searches for a denser function-group order. It regenerates the library and CLI linker fragments and records the measured dist baselines; runtime semantics are unchanged.
There is no review diff to integrate. The reviewed branch points at da7c6d56f, where the public-api snapshot repair had already been merged, and current origin/main is ahead of that commit.
Replaces the unrestricted string-backed config error escape hatch with specific, documented error variants carrying keys, values, reasons, paths, and environment indices. It also separates submodule layout/state failures into `SubmoduleError`, preserves the exact malformed section input during renames, and keeps CLI fatal-prefix behavior stable.
Refreshes the committed grit-lib API snapshot so its ordering exactly matches the pinned cargo-public-api generator. It only repositions six existing function signatures; no exported item, implementation, test, or runtime behavior changes.
Regenerates the two linker layout fragments so frequently executed library and CLI startup code is packed into fewer resident code windows. It also records the profiling diagnosis and commits before/after daily benchmark reports; there is no Rust source, public API, on-disk format, wire protocol, or command behavior change.
Adds a grit-lib batch API for per-commit insertion/deletion totals and makes `grit log` consume the library's existing batch diff API directly. The CLI no longer reads commits, tracks merge slots, or folds totals itself; output behavior remains under the same presentation mapping.
Adds the missing `rebase_run_request` import used by the history rebase CLI. This restores compilation and therefore unblocks the test and clippy CI jobs without changing runtime behavior.
This removes nine backend-specific reftable functions that only reopened ReftableRefStore and forwarded to its existing API. It also deletes an unused RpcChannel trait, its sole implementation, and the private post_round helper reachable only through that implementation; tests now exercise the canonical RefStore and generic reflog/ref APIs directly.
This review branch contains no changes relative to current origin/main. The missing `rebase_run_request` import was already delivered by another factory branch, so this branch now only confirms the repaired main commit.
Updates the committed grit-lib API snapshot so ConnectOptions::with_protocol_version appears under its explicit inherent impl block, exactly as the pinned generator emits it. No Rust source, behavior, formats, protocols, tests, or CLI surfaces are changed.
This verifies that the already-landed public API snapshot refresh repaired the red main CI job. The review branch itself has no commits or diff against origin/main, so there is no additional patch to integrate.
Updates one `Bundle::unbundle_with_progress` rustdoc sentence so its prerequisite-check reference resolves to the public bundle-fetch entry point. This removes the strict rustdoc failure without changing runtime behavior or public API shape.
This change teaches the generated hot-text linker layout about pick, revert, and merge, grouping their commonly executed code into resident-code-friendly sections. It updates both generated linker fragments and documents the measured Linux x86_64 dist results without changing Git behavior, public APIs, or repository formats.
Refreshes grit-lib’s committed public API snapshot to reflect the ref-store backend signatures and helpers that already exist in the implementation. This is a generated-snapshot correction only; it changes no Rust behavior or repository format.
This change batches the packed commit-header reads used to seed orphan/reachability paints, reuses pack and inflate state, and avoids faulting most of large pack-index OID tables through positioned row-window reads. It also moves the first parallel chunk onto the caller thread and records primed linkage in one lock acquisition; no public API or on-disk format changes.
This branch intentionally makes no source changes. It records that branch listing itself is already cheap and that the remaining tiny-command gap is dominated by process startup; independent review found the reviewed head and current-main dist executables byte-for-byte identical.
This change makes HTTP clone/fetch stop when a server accepts a connection but never sends response headers and low-speed settings are configured. It connects the existing low-speed window to ureq's response-header receive timeout while retaining the existing body-throughput reader after headers arrive.
When HTTP low-speed limits are configured, the ureq client now applies the low-speed window to receiving response headers. This closes the silent-server gap before the existing body-rate reader begins; the reviewed commit is already present in origin/main, leaving no mesh diff to integrate.
Refreshes the committed grit-lib API inventory to exactly match the API generated by the repository's pinned cargo-public-api 0.52.0 toolchain. It records one blame field, the EffectiveCommitParents surface, and the generated field ordering for TagData; runtime code is untouched.