fix: scope git add to vault directories in auto-commit.sh#40
Open
xiaolai wants to merge 1 commit intoagenticnotetaking:mainfrom
Open
fix: scope git add to vault directories in auto-commit.sh#40xiaolai wants to merge 1 commit intoagenticnotetaking:mainfrom
xiaolai wants to merge 1 commit intoagenticnotetaking:mainfrom
Conversation
git add -A staged every file in the project root, including dotfiles and credentials that may have been accidentally placed outside the vault's knowledge directories. Scoping to the known vault paths (notes/, ops/, self/, inbox/, templates/, .arscontexta) prevents inadvertent staging of sensitive content while still capturing all intentional vault writes. Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security Fix (LOW)
File:
hooks/scripts/auto-commit.sh:29The hook used
git add -Ato stage all tracked and untracked files in the project root. This means any file inadvertently placed in the project directory — dotfiles, credential files, API keys,.envfiles — would be staged and committed automatically on every Write event without the user noticing.Fix
Replaced
git add -Awith explicit paths scoped to the vault's known knowledge directories:This captures every file the hook is actually designed to commit while leaving anything outside those directories unstaged. The
|| trueensures the hook exits cleanly if the directories don't exist yet (e.g., early in vault setup).Note: if your vault uses custom folder names configured in
ops/derivation-manifest.md(e.g.,reflections/instead ofnotes/), you may want to adjust these paths to match. Thewrite-validate.shhook already scopes to*/notes/*and*/thinking/*for its checks, and this PR bringsauto-commit.shto the same principle.Files changed
hooks/scripts/auto-commit.sh