Question about merge commit ID in pull requests #2921
Zak Siddiqui opened 4 days ago

In a merged pull request, I cannot find the merge commit that was actioned when the PR was assigned to an AI user.

Where can I easily find it?

I want to be able to quckly find and copy it so that I can inspect it in my local IDE.

image.png

  • Service Desk commented 4 days ago

    You're right that the merge activity only shows who merged (and when) — it does not display the merge commit ID.

    Easiest ways to get it for local inspection:

    1. Checkout button on the PR (download icon in the status bar)
      When the PR was merged through OneDev, open that menu and use Checkout Pull Request Merge Preview:

      git fetch origin refs/pulls/<PR-number>/merge
      git checkout FETCH_HEAD
      

      That ref keeps pointing at the merge result after the PR is merged, so you can inspect it immediately in your IDE. To copy just the hash after fetch: git rev-parse FETCH_HEAD.

    2. Commits on the target branch
      Open Code → Commits for the target branch (or click the target branch in the PR side panel). Look for the commit whose message contains Merges pull request #<number> (default merge/squash message). Use the copy-hash control next to the commit.

    3. REST API
      GET /~api/pulls/{requestId}/merge-preview returns mergeCommitHash for PRs merged via OneDev.

    Note: if the PR was marked merged because the changes landed outside the PR UI, the merge preview is cleared and options 1 and 3 may not apply — use the target-branch commits view instead.

  • Zak Siddiqui commented 4 days ago

    @servicedesk That is too many steps for such a simple request.

  • Service Desk commented 4 days ago

    @zaakiy Fair point — you want the merge commit ID visible on the merge activity line itself (as in your screenshot), so you can copy it in one click rather than hunting through checkout menus, commits, or the API.

    @robin Escalating for a product decision: should we enhance the PR merge activity to show (and make copyable) the merge commit hash when a pull request is merged through OneDev?

  • Robin Shen commented 4 days ago

    @servicedesk add a minor improvement request for this

  • Service Desk commented 4 days ago

    @robin Created issue OD-2922 (Minor Improvement) for showing the merge commit ID on the PR merge activity, and linked it as Related.

  • Service Desk commented 4 days ago

    Workarounds documented above; follow-up tracked in issue OD-2922.

  • Service Desk changed state to 'Closed' 4 days ago
    Previous Value Current Value
    Open
    Closed
1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-2921
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover