Skip to content

fix(bootstrap): default run with hooks reaches the commit; repo with no commits works - #5

Merged
SaulBuilds merged 1 commit into
mainfrom
fix/bootstrap-hooks-and-empty-repo
Nov 29, 2026
Merged

SaulBuilds merged 1 commit into
mainfrom
fix/bootstrap-hooks-and-empty-repo

Conversation

@SaulBuilds

Copy link
Copy Markdown
Contributor

Summary

Two bootstrap.sh failures:

  • Step 7 (hooks): local hook_marker=... sat outside a function. bash rejects local there, and under set -e a default run (hooks on, i.e. without --no-hooks) exited before the commit. It is now a plain variable.
  • Step 6 on a repository with no commits: the day-zero commit came from git rev-parse HEAD 2>/dev/null || echo unknown. With no commits, rev-parse prints HEAD before failing, so the value became HEAD\nunknown and the sed that seeds BASELINE.md died on the newline. It now uses git rev-parse -q --verify HEAD (prints nothing on failure). The branch uses git symbolic-ref -q --short HEAD for the same reason.

Tests (tests/test_bootstrap_staging.py, new class BootstrapRunsEndToEnd)

  • A default run installs the three hook bridges (marker, executable) and commits.
  • A rerun updates its own bridges and leaves a foreign hook alone.
  • A repository with no commits bootstraps with --no-hooks and records day_zero_commit: "unknown" (no <full git hash> or HEAD\nunknown left in BASELINE.md).
  • A repository with no commits bootstraps with hooks too.

All four fail on the previous bootstrap.sh. Full module: 29 tests pass locally (python3 -m unittest discover -s tests -p test_bootstrap_staging.py).

🤖 Generated with Claude Code

https://claude.ai/code/session_01FPJzHNqGLdTVoFzde3Sxbw

…no commits works

- Step 7 declared `local hook_marker` outside a function. bash rejects
  that, and under `set -e` a default run (hooks on) exited there,
  before the commit. It is now a plain variable.
- Step 1 took the day-zero commit from `git rev-parse HEAD || echo
  unknown`. In a repository with no commits, rev-parse prints "HEAD"
  before failing, so the value became "HEAD\nunknown" and the step 6
  sed that seeds BASELINE.md died on the newline. It now uses
  `rev-parse -q --verify HEAD` (prints nothing on failure); the branch
  comes from `symbolic-ref -q --short HEAD` for the same reason.

Tests (tests/test_bootstrap_staging.py, BootstrapRunsEndToEnd): a
default run installs the three hook bridges and commits; a rerun
updates its own bridges and leaves a foreign hook alone; a repository
with no commits bootstraps with and without hooks and records
day_zero_commit "unknown". All four fail on the previous bootstrap.sh.

Signed-off-by: Larry Klosowski <larryklosowski@proton.me>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FPJzHNqGLdTVoFzde3Sxbw
@github-actions

Copy link
Copy Markdown

Claim grader (shadow mode)

Each commit / PR-text element scored against the claim-compression rubric. Shadow mode: this comment is informational; merge is not blocked.

Kind Id Score Verdict Reasons
pr_title PR #5 — grader-unavailable no API key in env (set ANTHROPIC_API_KEY or OPENAI_API_KEY); grader returns informational no-op until configured
pr_body PR #5 — grader-unavailable no API key in env (set ANTHROPIC_API_KEY or OPENAI_API_KEY); grader returns informational no-op until configured
commit b8d9546d — grader-unavailable no API key in env (set ANTHROPIC_API_KEY or OPENAI_API_KEY); grader returns informational no-op until configured

@BerryManifold BerryManifold left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Codex static review of b8d9546d8bd5ca2f0d762c07d82bce6b1640aede is complete. Result: blockers; details retained privately. Details and coverage limits are recorded in the project's private review log. No tests were executed by this reviewer. Both account submissions represent the same Codex review, not independent reviews.

@Matr0xshka Matr0xshka left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Codex static review of b8d9546d8bd5ca2f0d762c07d82bce6b1640aede is complete. Result: blockers; details retained privately. Details and coverage limits are recorded in the project's private review log. No tests were executed by this reviewer. Both account submissions represent the same Codex review, not independent reviews.

@SaulBuilds
SaulBuilds merged commit ba77da1 into main Nov 29, 2026
16 checks passed
@SaulBuilds
SaulBuilds deleted the fix/bootstrap-hooks-and-empty-repo branch November 29, 2026 17:33
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.

3 participants