Skip to content

checks: pre-commit leaves a staged submodule out - #2

Merged
lneto merged 1 commit into
masterfrom
claude_precommit_submodule
Nov 22, 2026
Merged

lneto merged 1 commit into
masterfrom
claude_precommit_submodule

Conversation

@lneto

@lneto lneto commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

The commit gate refuses a submodule staged under bin/, as Lunatik's bin/luaebpf is once luaebpf is mounted there (luainkernel/lunatik#2598), as a file missing its trailing blank line and its copyright header, so the commit that adds the mount, and every later one that moves it, cannot be made.

With this change the gate leaves a staged submodule out of the files it reads: a project commits a new mount, or a bump of one, under any path, and a file under bin/ without its header is still refused. Nothing a script calls changes.

The gate lists the staged paths and holds a path under bin/ to a trailing blank line and a
copyright header, so a submodule staged there, a project's mount moved or added, as Lunatik's
bin/luaebpf is (luainkernel/lunatik#2598), was refused as a file missing its header, and git show
of its path failed. --ignore-submodules=all leaves a gitlink out of the list, whose commit no gate
here reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lneto lneto added the complexity: small One line or one file, with a trivial or existing test label Nov 22, 2026
@lneto

lneto commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Note

This comment was written by an LLM, not a human.

Proof, run before the push:

  • Over a Lunatik worktree whose index adds the gitlink bin/luaebpf: bash tools/checks/pre-commit exits 1 at a28d3f7, "Files missing their copyright and license header: bin/luaebpf", and 0 at dd48c25.
  • Over a scratch repository that stages bin/x.sh with no header: the gate at dd48c25 still exits 1.
  • The Checks workflow passed at dd48c25.

@lneto
lneto merged commit c782c44 into master Nov 22, 2026
1 check passed
@lneto
lneto deleted the claude_precommit_submodule branch November 22, 2026 12:59
lneto added a commit to luainkernel/lunatik that referenced this pull request Nov 22, 2026
luainkernel/harness#2: the commit gate leaves a staged submodule out of the files it reads, so the
commit that mounts luaebpf at bin/luaebpf (#2598) passes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lneto added a commit to luainkernel/lunatik that referenced this pull request Nov 22, 2026
luainkernel/harness#2: the commit gate leaves a staged submodule out of the files it reads, so the
commit that mounts luaebpf at bin/luaebpf (#2598) passes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

complexity: small One line or one file, with a trivial or existing test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant