fix: detect missing git identity and show actionable error in setup#219
fix: detect missing git identity and show actionable error in setup#219kaixinbaba wants to merge 2 commits into
Conversation
stephengpope
left a comment
There was a problem hiding this comment.
Thanks for this — the problem is real and worth fixing. A few notes:
The identity check at the top is the right approach. Checking both user.name and user.email before proceeding, and falling back to the GitHub API, is exactly what should happen here.
One edge case with the check: If user.name succeeds but user.email fails, the catch block tries to set both from GitHub — overwriting a user.name the user already had configured. Consider checking them independently so you only auto-set what's actually missing.
The try-catch around git commit (lines 184-196) should be removed. The identity check above already guarantees git identity is configured by the time you reach the commit — either it was already set, it was set from GitHub, or setup exited. The commit can never fail with "Author identity unknown" after that check passes, so the catch is dead code.
The error messages themselves are great — clear and actionable. Just needs those two adjustments and this is good to go.
Fixes #178
Changes
user.nameANDuser.email(previously only checkeduser.name)git commitcall in try-catch to detect identity errorsWhy This Fix Matters
Previously, if a user had
user.nameconfigured but was missinguser.email, the setup would silently fail duringgit commitwith no helpful guidance. Now users get clear instructions on how to fix the issue.