Repository navigation
Add opt-in UPX clean/smudge filters - #69
Merged
Merged
Conversation
Member
Author
|
x86_64 counterpart PR: git-for-windows#136 |
This was referenced Nov 2, 2026
Large DLLs can exceed remote file-size limits. UPX-packed binaries
remain runnable without filter configuration, at the cost of startup
decompression. Provide opt-in local filtering so users can trade disk
space for avoiding that repeated cost while Git keeps compressed blobs.
Provide clean, smudge, and setup modes in .large-dll-filter.sh. Prefer
the checkout's ucrt64/bin and clangarm64/bin on PATH so the same script
works in both SDKs and from a regular Git Bash.
After checkout, enable filtering and unpack existing attributed files:
bash ./.large-dll-filter.sh setup
Use setup --no-refresh in package-update automation to configure the
driver without rewriting working-tree files. Setup installs these
repository-local values:
filter.upx.clean = bash ./.large-dll-filter.sh clean
filter.upx.smudge = bash ./.large-dll-filter.sh smudge
filter.upx.required = true
Require successful filtering to avoid silently staging unpacked blobs
when clean fails. Attribute selection remains separate from setup.
Unpack existing packed files directly in the working tree, leaving the
index unchanged. Partial optimization is harmless, since both forms
work. Skip absent files, symlinks, and files not recognized as packed.
Disable Git's filename quoting when enumerating Windows paths so
spaces and Unicode names are preserved.
Use private temporary files for stream conversion, where UPX's file
interface requires them, and --exact to preserve original bytes.
Help is available with --help, -h, or -?.
Assisted-by: GPT-6.1 Sol
Signed-off-by: Matthew John Cheetham <[email protected]>
mjcheetham
force-pushed
the
upx-filter
branch
from
November 3, 2026 11:06
d53af03 to
77aee62
Compare
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.
Summary
Add opt-in clean/smudge filtering for large DLLs. Git stores UPX-packed binaries, while users can choose unpacked working-tree files to avoid decompression at startup.
Packed binaries remain runnable, so ordinary clones work without filter configuration or special checkout steps.
Usage
After checkout:
For configuration only, without unpacking existing files:
Help is available with
--help,-h, or-?.Revised design
Following review, filtering and setup share one hidden script,
.large-dll-filter.sh, withclean,smudge, andsetupmodes.The script prepends the checkout's UCRT64 and clangarm64 bin directories to PATH. Setup configures repository-local filters and directly unpacks existing attributed files. It does not replace files from the index or require transactional conversion: partially unpacked checkouts work too.
Clean/smudge retain private temporary files to bridge Git's streams to UPX's file interface. Packing uses
--exactto preserve original bytes. The local driver is required so failed clean operations cannot silently stage unpacked binaries.No filter attributes are introduced here. Selecting Rust's LLVM DLLs and configuring package-update automation are separate follow-ups.
Validation
Tested with packaged x64 UPX in both SDK directory layouts: lossless round trips, stable staging, repeated setup, configuration-only setup, Unicode and spaced paths, missing files, preservation of local working-file edits, and filter failure handling.
The script is identical across both SDK repositories. Native ARM64 execution has not been tested locally.