Add automatic rebuilding for ordered custom asset sources - #3979
Open
Matei02355 wants to merge 3 commits into
Open
Add automatic rebuilding for ordered custom asset sources#3979Matei02355 wants to merge 3 commits into
Matei02355 wants to merge 3 commits into
Conversation
Matei02355
marked this pull request as ready for review
September 7, 2026 14:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Custom caches currently require a manual rebuild after a version mismatch or source change. Add
bat cache --build --automaticto record source directories and build options and rebuild when their contents or bat's version change.Repeat
--sourceto combine system package assets with user assets. Later sources take precedence for theme names and syntax lookup. Link the syntax definitions together so user grammars can include system grammars, and collect acknowledgements from every source. Package scripts only install shared source files; each user's opt-in automatic cache refreshes after package updates, additions and removals. Shared paths are explicit and are never written by the builder. Preserve the public single-directory build API and add build_from_dirs for library callers.Automatic mode follows source symlinks and uses content fingerprints. Rebuilds run locally with captured progress output and publish complete cache generations atomically. The explicit cache remains available to library clients; separate generations allow different bat versions to coexist. Failed builds preserve existing caches, concurrent builders reuse the same complete generation, and corrupt generations can be repaired. Single-source recipes remain readable.
Manual mode remains the default. A build without --automatic disables automatic updates. --no-custom-assets bypasses the mode, and cache --clear removes its recipe and generations. Document source-read costs, source availability and system/user setup, and update completions.
Validation: 490 tests passed with all features, including 17 new process/library regressions; seven platform/manual tests were ignored. Coverage includes source ordering, syntax/theme collisions, cross-source context linking, package updates/removals, acknowledgements, old recipes, unchanged timestamps, version incompatibility, malformed sources, concurrent builds, corruption repair, opt-out/clear, coincident source and target directories, missing sources and symlinks. All-target/all-feature Clippy, the minimal regex-onig library build, formatting and rendered Bash/Zsh completion syntax checks passed.
Fixes #2085 and #2559.