fix(open-knowledge): discover git identity from included git configs (#2864)#783
Merged
Conversation
…(#2864) * fix(open-knowledge): discover git identity from included git configs Auto-save commit identity resolution probed the worktree, local, and global git config scopes one at a time. Scope-limited reads do not expand include or includeIf directives, so users who set user.name and user.email through conditional includes (gitdir or hasconfig identity switching) saw a spurious 'Git identity isn't set' nudge and their sync commits were authored as the generic OpenKnowledge fallback. Read the effective merged config instead (git config --get from the project dir), which is exactly what git resolves for a commit: full scope precedence plus resolved includes. Integration tests cover unconditional include, gitdir, and hasconfig conditions against a real git repo with an isolated global config. Fixes #769. Supersedes #2844, re-authored so the commit identity maps to a GitHub account, with the new tests importing vitest directly instead of the bun:test shim. * fix(open-knowledge): address identity-resolution review feedback Use GIT_CONFIG_NOSYSTEM=1 in the includes test instead of pointing GIT_CONFIG_SYSTEM at /dev/null, which is POSIX-only. Update the two caller-side comments that still described the old scope-by-scope resolution chain (sync-engine commit path and the sync-status hook). * test(open-knowledge): round out identity review feedback Add the symmetric name-only fallthrough unit test so both partial-config paths guard the name-and-email pair requirement. Rewrite the worktree test comment that still described the retired per-scope --worktree probe in terms of the merged read, and migrate the file's bun:test import to vitest to match its siblings. GitOrigin-RevId: 84657972e36d4e74e2778bb766f9c5a6e0f79292
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.
Copybara-translated 1 Inkeep OSS change. Rebase-merge this PR so the prepared commit lands directly on public main.