Skip to content

Add samebytes' stat-cache hook, its LF pin, and a CI job that checks the copies - #3

Merged
loggger101 merged 1 commit into
mainfrom
samebytes-hooks
Oct 26, 2026
Merged

loggger101 merged 1 commit into
mainfrom
samebytes-hooks

Conversation

@loggger101

Copy link
Copy Markdown
Owner

This tree lives in a synced folder (OneDrive), where git's stat cache goes stale: the sync client reports a placeholder file size right after a checkout, every later git status calls the file modified, and git merge --ff-only / git checkout refuse on changes that do not exist. economicspace has carried a hook for this since 2026-08; it now ships in samebytes v0.1.0, and this gives the same hook to this repo.

  • .githooks/ (drive-restat.sh plus post-checkout, post-merge and post-rewrite), byte for byte samebytes' packaged copies, tracked executable. The repair re-stats only entries whose content already matches the index, so it cannot stage, hide or discard a real edit.
  • .gitattributes pins .githooks/* text eol=lf; without it a Windows clone (core.autocrlf true) checks the hooks out CRLF and #!/bin/sh fails silently.
  • A hooks CI job runs python -m samebytes hooks check ., which fails on drift, CRLF, a missing eol pin or a missing executable bit.
  • Opt in once per clone: git config core.hooksPath .githooks (already set on this machine).

No package code changes, no release.

Verified locally: samebytes hooks check --require-config clean; the test suite passes.

…the copies

.githooks/ is samebytes v0.1.0's packaged hook (drive-restat.sh and the
three post-* hooks that run it), tracked executable; .gitattributes pins
it to LF so a Windows clone cannot check it out CRLF; the `hooks` CI job
fails on drift, CRLF, a missing eol pin or a missing executable bit.
@loggger101
loggger101 merged commit da3d032 into main Oct 26, 2026
10 checks passed
@loggger101
loggger101 deleted the samebytes-hooks branch October 26, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant