Skip to content

feat(helpers4-common): warn about unfixable host-bound git config paths - #90

Merged
baxyz merged 2 commits into
mainfrom
self-heal-warn-unfixable-paths
Sep 8, 2026
Merged

baxyz merged 2 commits into
mainfrom
self-heal-warn-unfixable-paths

Conversation

@baxyz

@baxyz baxyz commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • git-config-self-heal.sh only ever fixed shell-out keys (PATH-searchable) and an SSH signing key (derivable from the forwarded agent). core.hooksPath, core.excludesfile, core.attributesfile, and include.path/includeIf.*.path all point at a file or directory that only ever existed on the host, with no equivalent recovery path — adds a warning-only check for all four, matching the script's existing best-effort/never-fails contract.
  • git config --file never follows includes, so an included file's own contents (if it even exists) stay invisible to every check in this script — this can only confirm whether the included file itself is present. Documented in both the script and the README.
  • Also fixes the shell-out key list in the README, which still said "core.editor" without core.sshCommand (added in a prior release and never backfilled there).
  • Patch bump (1.2.01.2.1), not minor: this only adds diagnostic warnings for paths self-heal already couldn't do anything about — nothing it fixes or enables changed.

Verified end-to-end, not just unit-style: installed the real generated common.sh and git-config-self-heal.sh at their actual /usr/local/share/helpers4/ path and ran the full test/helpers4-common/test.sh against them. Caught and fixed a real bug this way — git normalizes includeIf's key to lowercase (includeif, not includeIf), so the first version of that check never matched anything.

Board card: "Self-heal: warn on host-bound config paths that can't be repaired (hooksPath, excludesfile, includeIf)" (Backlog, Low priority).

Test plan

  • bash -n syntax check, JSON validated
  • Full end-to-end run against the real installed files: missing hooksPath/excludesfile/include.path/includeIf.*.path each warn without failing, an existing path is left alone, no keys set = silent no-op
  • New test cases added to test/helpers4-common/test.sh
  • CI

🤖 Generated with Claude Code

…aths

git-config-self-heal.sh only ever fixed shell-out keys (PATH-searchable) and
an SSH signing key (derivable from the forwarded agent). core.hooksPath,
core.excludesfile, core.attributesfile, and include.path/includeIf.*.path
all point at a file or directory that only ever existed on the host, with no
equivalent recovery path — so this adds a warning-only check for all four,
never a fix, matching the script's existing best-effort/never-fails
contract.

git config --file never follows includes, so an included file's own
contents (if it even exists) stay invisible to every check in this script —
this can only confirm whether the included file itself is present, not
inspect what it sets. Documented in both the script and the README.

Verified locally end-to-end against the real installed common.sh and
git-config-self-heal.sh (not just the install.sh generator): missing
hooksPath/excludesfile/include.path/includeIf.*.path each warn without
failing, an existing path is correctly left alone, and a config with none of
these keys is a silent no-op. Caught and fixed a real regex bug along the
way — git normalizes includeIf's key to lowercase ("includeif", not
"includeIf"), so the first version of the includeIf check never matched
anything.

Also fixed the shell-out key list in the README, which still said
"core.editor" without core.sshCommand, added in a prior release.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

✅ PR Validation Passed

All checks passed!


📋 Pipeline Status

Job Status
🧾 Conventional Commits passing
🔖 Version Bump passing
🧪 Feature Tests passing
🐚 ShellCheck passing

🤖 Generated by @helpers4 CI • 2026-09-08

1.3.0 implied new functionality. This only adds diagnostic warnings for
paths self-heal already couldn't do anything about — nothing it fixes or
enables changed. Patch-level: 1.2.0 -> 1.2.1.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@baxyz
baxyz merged commit 3f98720 into main Sep 8, 2026
39 checks passed
@baxyz
baxyz deleted the self-heal-warn-unfixable-paths branch September 8, 2026 21:19
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