Repository navigation
Re-merge PR #6 onto main (encrypt already-tracked files on add) - #10
Merged
Merged
Conversation
`add file`/`add field` only wrote the rule and .gitattributes line. If a matching file was already tracked and unchanged in the working tree, git kept trusting its cached stat info and never re-invoked the clean filter, so the file stayed plaintext in the repository indefinitely — contradicting the documented "no further step" promise, and silently so until `nebel status` was run. Both subcommands now renormalize (git add --renormalize equivalent) any currently tracked file that config.MatchRule resolves to the rule just written, reporting what got encrypted and warning that already-committed history is unaffected. Scoped to nebel's own rule matching rather than a raw pathspec, so a brand-new glob matching nothing yet isn't an error. gitutil gains Renormalize (RenormalizeAll's scoped sibling) and TrackedFiles, both using `git ls-files -z`/`-s -z` so a non-ASCII filename (which git quotes as a C-style escaped string by default) doesn't silently fall out of scope. Co-Authored-By: Claude Sonnet 5 <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.
Summary
PR #6 ("nebel add: encrypt already-tracked files immediately") shows as merged on GitHub, but its actual commit is not reachable from current
main—mainwas reset to an earlier point after that merge, silently dropping it while GitHub kept the "merged" badge. This PR re-applies that same commit (8e1d550) on top of currentmain, which now also includes the six mitigation-plan fixes from PR #5 and #7.Cherry-picked cleanly with no conflicts, verified by hand since it touches two files those PRs also changed (
cmd/nebel/add.go,internal/gitutil/gitutil.go):add.go: the P07 glob-escaping fix (escapeGitattributesPattern) is untouched; PR nebel add: encrypt already-tracked files immediately #6's newfilesMatchingNewRule/renormalizeAndReportcorrectly layers on top, and was in fact already written with the P07 finding in mind (usescfg.MatchRulerather than a raw pathspec).gitutil.go: the P01 dirty-check (DirtyFiles/ErrDirtyManagedFiles/CheckoutAll) is untouched; PR nebel add: encrypt already-tracked files immediately #6's newRenormalize/TrackedFilessit alongside it, andManagedFilesnow reusesTrackedFiles.Test plan
go build ./...,go vet ./...,go test ./... -count=1all pass🤖 Generated with Claude Code