Skip to content

fix(hooks): keep the sync counter beside the git dir, not in the tree - #3392

Merged
gHashTag merged 1 commit into
masterfrom
counter-out-of-the-tree
Sep 6, 2026
Merged

fix(hooks): keep the sync counter beside the git dir, not in the tree#3392
gHashTag merged 1 commit into
masterfrom
counter-out-of-the-tree

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Closes #3391

.githooks/pre-commit increments .trinity/notebook_commit_count on every commit, and that file was tracked. Every commit therefore dirtied the worktree, and git refused to move:

error: Your local changes to the following files would be overwritten by checkout:
        .trinity/notebook_commit_count

Three refused checkouts and a refused merge in one day. Once it was worse than an inconvenience: the checkout meant to move onto a new branch failed, the edit that followed landed on the branch still checked out, and the pull request opened from there carried a neighbour session's changes as well — closed and rebuilt. The file has also reached 13 commits, every one a git add -A that swept it in.

It is per-machine session state with exactly one reader in the whole repository: the hook itself.

Moved beside the git dir, where the hooks already live and nothing can reach a commit, plus .gitignore. --git-common-dir, not --git-dir — worktrees share one repository, and "commits since the last sync" is a fact about the repository rather than about a checkout. Same place tri window keeps its measurement base, for the same reason.

Control: after a commit the worktree is clean (git status --porcelain → 0 lines), the counter has incremented inside .git/, and a checkout and a merge immediately afterwards both succeed with nothing to restore first.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-06 18:04:00 UTC

Summary

Status Count
Total Open PRs 16
PRs with Failing Checks 12
PRs with All Checks Green 4
READY 1
FAILING 12
PENDING 0
NO CHECKS YET 0

These columns do not partition: 1 + 12 + 0 + 0 = 13, and there are 16 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=745cf51f9c7e != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@gHashTag
gHashTag merged commit 65cecf3 into master Sep 6, 2026
27 of 28 checks passed
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.

A hook writes a tracked file on every commit, and it refused three checkouts and a merge in one day

1 participant