Skip to content

Add setting to show commit SHAs in tree#8840

Open
jameswilmiller wants to merge 1 commit into
microsoft:mainfrom
jameswilmiller:show-commit-sha-in-tree
Open

Add setting to show commit SHAs in tree#8840
jameswilmiller wants to merge 1 commit into
microsoft:mainfrom
jameswilmiller:show-commit-sha-in-tree

Conversation

@jameswilmiller

@jameswilmiller jameswilmiller commented Jul 13, 2026

Copy link
Copy Markdown

I wasn't sure whether community contributions were being accepted but I took the liberty of making the PR.

Summary:

Adds a new setting that displays abbreviated commit SHAs in the pull request commits tree.

When enabled, commit descriptions are shown in the following format:

49334c4 · 2 days ago

I went with this design decision because date will truncate before SHA which I believe is the more important
piece of information when reviewing the commits as a list. If you believe a different direction would be better feel free to comment.

The setting defaults to disabled, so the existing behaviour remains unchanged.

Changes:

  • Added the githubPullRequests.showCommitShaInTree setting.
  • Added localized text for the setting.
  • Displayed the first seven characters of the commit SHA when the setting is enabled.
  • Preserved the relative commit date when available.
  • Refreshed the commits tree immediately when the setting changes.

Testing:

manually verified that:

  • The setting is disabled by default.
  • Enabling the setting displays the abbreviated commit SHA.
  • Disabling the setting removes the SHA.
  • The commits tree updates without reloading the window.
  • Commits with a date display · .
  • Commits without a date display only the short SHA when enabled.
  • Existing commit-tree functionality continues to work.

No automated tests were added ( I wasn't sure whether this was required but I am happy to write some if needed ).

I have attached screenshots below,

Screenshots

Setting:
image

Disabled Setting:
image

Disabled Setting with no date:
image

Enabled Setting:
image

Enabled Setting with no date:
image
Fixes #8701

Copilot AI review requested due to automatic review settings July 13, 2026 16:25
@jameswilmiller

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

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.

Pull Requests / Commit Message

2 participants