Strip metadata from VHS-generated images for deterministic builds#42
Merged
Conversation
Copilot
AI
changed the title
[WIP] Enhance determinism of image generation in vhs-build.sh
Strip metadata from VHS-generated images for deterministic builds
Oct 31, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a metadata stripping utility to make VHS-generated PNG and GIF images deterministic. The implementation removes timestamps and other variable metadata from images, ensuring that regenerating images with unchanged content produces identical files, avoiding unnecessary git commits.
Key changes:
- Added
vhs-strip-metadata.shscript with ImageMagick support for both v6 and v7 - Integrated metadata stripping into the VHS build workflow
- Updated documentation to explain the determinism benefits
Reviewed Changes
Copilot reviewed 5 out of 67 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/screencasts/bin/vhs-strip-metadata.sh | New script that strips metadata from PNG/GIF files using ImageMagick |
| docs/screencasts/README.md | Documents the new metadata stripping functionality and its purpose |
| docs/img/practical-workflows/wip-workflow.png | Binary image file (regenerated with metadata stripped) |
| docs/img/practical-workflows/branch-create.png | Binary image file (regenerated with metadata stripped) |
| SCREENSHOT_GENERATION.md | Updated documentation to include metadata stripping step |
| Makefile | Integrated metadata stripping into VHS build targets |
| .github/workflows/regenerate-vhs-images.yml | Added ImageMagick to CI dependencies |
Co-authored-by: elifarley <519940+elifarley@users.noreply.github.com>
- Created vhs-strip-metadata.sh to strip metadata from all PNG/GIF images - Added vhs-strip-metadata Makefile target - Updated vhs, vhs-build-one, and vhs-regenerate targets to call metadata stripping - Updated GitHub workflow files to install ImageMagick - Verified end-to-end: regenerated images now produce identical checksums Co-authored-by: elifarley <519940+elifarley@users.noreply.github.com> # Conflicts: # docs/commands/img/hug-COMMAND.gif # docs/commands/img/hug-branch-demo.gif # docs/commands/img/hug-commit-demo.gif # docs/commands/img/hug-h-back.png # docs/commands/img/hug-head-demo.gif # docs/commands/img/hug-la.png # docs/commands/img/hug-lc.png # docs/commands/img/hug-lla.png # docs/commands/img/hug-sl-staged.png # docs/commands/img/hug-sl-unstaged.png # docs/commands/img/hug-status-changes.gif # docs/commands/img/hug-t.png # docs/commands/img/hug-twc.png # docs/commands/img/hug-working-dir-demo.gif # docs/img/hug-for-beginners/hug-aa.png # docs/img/hug-for-beginners/hug-b-switch.png # docs/img/hug-for-beginners/hug-bc.png # docs/img/hug-for-beginners/hug-c.png # docs/img/hug-for-beginners/hug-h-back.png # docs/img/hug-for-beginners/hug-m.png # docs/img/hug-for-beginners/hug-wip.png
- Updated screencasts/README.md with vhs-strip-metadata information - Updated SCREENSHOT_GENERATION.md with metadata stripping workflow - Documented why deterministic images matter for version control Co-authored-by: elifarley <519940+elifarley@users.noreply.github.com>
- Support both ImageMagick v6 (convert) and v7 (magick) commands - Optimize find command to use single invocation with path pattern - Add CONVERT_CMD variable to dynamically select the right command - Verified end-to-end: deterministic output still works correctly Co-authored-by: elifarley <519940+elifarley@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
cd9b97f to
a39ef17
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.
VHS embeds timestamps in PNG/GIF files, causing identical content to generate different hashes on each build. This creates spurious git diffs when regenerating documentation images.
Changes
New script:
docs/screencasts/bin/vhs-strip-metadata.shdocs/**/img/*.{png,gif}using ImageMagickconvert -stripconvert) and v7 (magick) commandsfind "$DOCS_DIR" -path "*/img/*" -type f \( -name "*.png" -o -name "*.gif" \)Makefile integration
vhs-strip-metadatavhs,vhs-build-one, andvhs-regenerateafter image generationCI/CD updates
imagemagickto workflow dependency installationsVerification
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.