Skip to content

fix(open-knowledge): discover git identity from included git configs (#2864)#783

Merged
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync
Jul 23, 2026
Merged

fix(open-knowledge): discover git identity from included git configs (#2864)#783
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync

Conversation

@inkeep-oss-sync

Copy link
Copy Markdown
Contributor

Copybara-translated 1 Inkeep OSS change. Rebase-merge this PR so the prepared commit lands directly on public main.

…(#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
@inkeep-oss-sync
inkeep-oss-sync Bot merged commit cbdc10b into main Jul 23, 2026
@inkeep-oss-sync
inkeep-oss-sync Bot deleted the copybara/sync branch July 23, 2026 15:06
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