Shelve command includes large binary files in .hg/shelve bundle causing unexpected size growth
0 reputation · 31 Mar 2025, 11:39 UTC
The shelve command stores changes as a bundle in .hg/shelve. When the working directory contains large binary files, those binaries are included unchanged in the bundle, which can cause the shelve directory to grow unexpectedly and affect disk usage in CI pipelines that rely on shelve for temporary storage. The documentation does not specify whether shelve should exclude or compress large binaries, and no official decision has been made about adding a flag such as --exclude-binaries or automatic compression.
Clarifying the intended behavior would help users decide whether to manually clean .hg/shelve or adopt work‑arounds.
Should the shelve command provide an option to exclude binary files from the bundle? Should it automatically compress large binaries when creating the shelve bundle? What is the recommended practice for users who need to shelve changes that include large binary assets without incurring excessive storage growth?