Skip to content

fix(doctor): report effective per-directory identity, not just global#34

Merged
OfirHaim1 merged 1 commit into
mainfrom
fix/doctor-effective-identity
Jun 18, 2026
Merged

fix(doctor): report effective per-directory identity, not just global#34
OfirHaim1 merged 1 commit into
mainfrom
fix/doctor-effective-identity

Conversation

@OfirHaim1

Copy link
Copy Markdown
Member

doctor read the git identity via git.GlobalIdentity() (git config --global), so it always printed the global user.name/email and ignored the includeIf blocks gitswitch itself writes to bind a directory to an identity. In a bound directory it reported the wrong identity even though commits went out correctly — a display bug, not a behavior bug.

Switch the git row to git.EffectiveIdentity() (git config without --global, which respects local repo config and includeIf chains), and additionally show the global identity when it differs so the switch is visible. Add EffectiveIdentity() mirroring GlobalIdentity, plus a regression test that a local override wins over global.

doctor read the git identity via git.GlobalIdentity() (git config
--global), so it always printed the global user.name/email and ignored
the includeIf blocks gitswitch itself writes to bind a directory to an
identity. In a bound directory it reported the wrong identity even
though commits went out correctly — a display bug, not a behavior bug.

Switch the git row to git.EffectiveIdentity() (git config without
--global, which respects local repo config and includeIf chains), and
additionally show the global identity when it differs so the switch is
visible. Add EffectiveIdentity() mirroring GlobalIdentity, plus a
regression test that a local override wins over global.
@OfirHaim1 OfirHaim1 merged commit 3a9f674 into main Jun 18, 2026
1 check passed
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