Skip to content

Pull Requests / Commit Message #8701

Closed

Description

Feature Request

When viewing a pull request's commits in the Pull Requests tree view, each commit currently shows:

  • Label: commit message
  • Description: relative date (e.g. "2 months ago")

I'd like an option to include the short SHA (e.g. a1b2c3d) in the commit display, for example:

  • a1b2c3d commit message as the label, or
  • short SHA as the description (instead of or in addition to the relative date)

Use Case

When reviewing PRs with many commits, the SHA is essential for cross-referencing with git log, cherry-picking, or discussing specific commits with teammates. Currently I have to hover or expand each commit to find its SHA.

Suggestion

A setting like githubPullRequests.commitLabel with options such as:

  • message (current behavior, default)
  • sha-message (e.g. a1b2c3d commit message)

Or alternatively, add the short SHA to the description field alongside the relative date (e.g. a1b2c3d · 2 months ago).

The relevant code is in src/view/treeNodes/commitNode.ts:

this.label = commit.commit.message;
this.description = commit.commit.author?.date ? dateFromNow(commit.commit.author.date) : undefined;
Image

Activity

  1. added
    feature-request
    on Apr 28, 2026
  2. added this to the Backlog milestone on Apr 28, 2026
  3. jameswilmiller commented on Jul 10, 2026

    @jameswilmiller
    Contributor

    I'd be happy to submit a PR for this if you're open to a community contribution.

    Of the two designs proposed, I'd lean toward adding the short SHA to the description field behind a setting, since it doesn't change the default label behavior, but happy to implement whichever direction you'd prefer, or a simpler no-setting version if you'd rather avoid a new config option.

  4. jameswilmiller commented on Aug 19, 2026

    @jameswilmiller
    Contributor

    Alex Ross (@alexr00) , I have a PR open for this issue, rebased and tested. I am happy to adjust the approach if the team prefers a different direction. No rush on my end, just wanted to be ready to adjust the PR if needed when it fits a milestone.

  5. vs-code-engineering commented on Sep 1, 2026

    @vs-code-engineering

    Sharing media and context from merged PR #8840 for verification:

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

    Summary:

    Initially pull request added a new setting to display abbreviated commit SHAs in the pull request commits tree.

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

    49334c4 · 2 days ago

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

    PR was modified upon review to make SHA always show in tree, and the setting was removed.

    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

    Source PR: #8840

  6. alexr00 commented on Sep 4, 2026

    @alexr00
    Member

    To verify:

    • Open a folder that contains a GitHub repo
    • From the Pull Requests view, check out a PR
    • From the Changes in Pull Request view, expand the commits
    • Verify that next to each commit you see both the date and the short commit sha
  7. justschen commented on Sep 4, 2026

    @justschen

    Alex Ross (@alexr00) i actually don't see the setting in the latest insiders and on the latest extension version

  8. jameswilmiller commented on Sep 5, 2026

    @jameswilmiller
    Contributor

    Justin Chen (@justschen) Hi Justin,

    Sorry I didn't update on the issue page to make it clear, the pull request was modified upon review to remove the setting and always show the abbreviated sha, I just did a quick sanity check to make sure it definitely works, here is the image below.

    Image

    feel free to use this repo as a test, but on my end I can see the abbreviated sha displayed after clicking checkout. https://github.com/jameswilmiller/VSCODE_PR_TEST

  9. alexr00 commented on Sep 7, 2026

    @alexr00
    Member

    Justin Chen (@justschen) no setting needed, you should be able to just follow the steps in #8701 (comment)!

  10. removed
    verification-found
    on Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-request

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions