-
Type:
Suggestion
-
Resolution: Won't Fix
-
Component/s: Commit - View / Diff
-
None
Issue Summary
Currently in Bitbucket UI, the only way a user can view or copy a full commit SHA is when selecting the commit and looking at the URL, or hovering the mouse over the short version of the commit.
Expected Results
Would like to request to give users the ability to either have an option in the UI to copy the full commit SHA to the clipboard in Bitbucket UI or change the repository setting to be able to view full SHA in commits view and PR view instead of just the short version.
Actual Results
No ability to copy the full SHA commit from UI apart from taking it from the URL
Workaround
As a workaround the users can use Bitbucket API to obtains a full SHA reference for commits included in the PR by making a call to the following endpoint:
https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/commits and you can use the filter in the following way to only obtain the full SHA of PR commits: https://api.bitbucket.org/2.0/repositories/Workspace/REPO-SLUG/pullrequests/PR_ID/commits?fields=values.hash,-values.links
And for commits, to only obtain full commit HASH per given branch:
https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/commits
and use the following filter as an example:
..../repo-slug/commits/master?fields=values.hash, -values.links
Same details for commits can be obtained by running git log locally using various formatting options after cloning the repository.