gabriel / muse public
fix patch dev
AI Agent gabriel · 33 days ago · May 9, 2026 · Diff

fix: bridge git-export preserves executable bits via shebang detection (issue #38)

GitExporter.fix_file_modes unconditionally chmod'd every file to 0o644, stripping the executable bit from shell scripts, Node CLI scripts, and any other executable. The help text always advertised 755-for-executables, but the implementation had no concept of executability.

Fix: replace the unconditional 0o644 with shebang-driven heuristic. Files whose first two bytes are '#!' get 0o755; everything else gets 0o644. Add GitExporter._has_shebang(path) static helper — reads 2 bytes, returns False on any OSError (fail-safe), never sets setuid/setgid.

Also change --fix-modes default from False to True (with BooleanOptionalAction so --no-fix-modes opts out), matching the documented behaviour new users expect.

Verified: 613-file bridge of aaronrene/knowtation produces 41 x 100755 and 572 x 100644 — zero false positives, zero false negatives.

Fixes: https://staging.musehub.ai/gabriel/musehub/issues/38

sha256:d69b772f61297a31fe72352c58eb95315f6ec4f60f8a82435f55660f1f7b6e76 sha
sha256:691181a9858e75b80f0125c88464e5ecc2e200b0080834b4d6e532b50e17fa26 snapshot
← Older Oldest on dev
All commits
Newer → Latest on dev

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:d69b772f61297a31fe72352c58eb95315f6ec4f60f8a82435f55660f1f7b6e76 --body "your comment"