Skip to content

Fix vscode blame username - #1418

Open
Mukesh-SCS wants to merge 1 commit into
facebook:mainfrom
Mukesh-SCS:fix-719-vscode-blame-username
Open

Fix vscode blame username#1418
Mukesh-SCS wants to merge 1 commit into
facebook:mainfrom
Mukesh-SCS:fix-719-vscode-blame-username

Conversation

@Mukesh-SCS

Copy link
Copy Markdown

Fixes #719.

VS Code inline blame currently uses the OS username to determine whether a commit should be annotated with (you). This can produce false matches when the OS username appears in another author's name or email.

This change uses Sapling's configured ui.username instead.

The username is loaded once per repository and cached with the existing blame state. Blame loading waits for the username lookup to finish so the first annotation is rendered with the correct identity.

If ui.username is missing or cannot be read, commits are not marked as (you). Local uncommitted changes continue to display (you) • Local Changes.

Test Plan

Added regression coverage for:

  • another author's email containing the OS username
  • matching the configured ui.username
  • missing and empty ui.username
  • fetching ui.username only once per repository
  • concurrent blame loads sharing the same username lookup
  • waiting for ui.username before the first blame render
  • preserving (you) for local uncommitted changes

Ran:

npx --yes yarn@1.22.22 workspace sapling-scm test extension/blame/__tests__/blame.test.ts --runInBand

Result: 15 tests passed

Also ran:

npx --yes yarn@1.22.22 workspace sapling-scm lint
git diff --check

Lint completed with no errors in the changed files.

@meta-cla meta-cla Bot added the CLA Signed label Aug 18, 2026
@meta-codesync

meta-codesync Bot commented Aug 18, 2026

Copy link
Copy Markdown

This pull request has been imported. If you are a Meta employee, you can view this in D116501720. (Because this pull request was imported automatically, there will not be any future comments.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[VS Code] configure username for blame

2 participants