Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is it possible to get a hash of merge commit before merge?

kamal.mohammed
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 20, 2021

Hi

I am trying to get the test merge commit ie.., before merging a pull request it will test the merge to see if any merge conflicts exist or not.  In GitHub its providing a merge_commit_sha (The value of the merge_commit_sha attribute changes depending on the state of the pull request. Before merging a pull request, the merge_commit_sha attribute holds the SHA of the test merge commit. After merging a pull request, the merge_commit_sha attribute changes depending on how you merged the pull request) .

 

So can we get the same in Bitbucket too or its already there? if its already there then how can I get the test merge commit in bitbucket?

Thanks

1 answer

1 accepted

0 votes
Answer accepted
Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 25, 2021

Hi, @kamal.mohammed! Welcome to the community! 

No, this is not possible. Just to give you some context about the reason that this is not possible, a commit contains the description of elements such as the author of the commit, the content of the commit (the list of files + directories that make up this commit), the commit's parents, the timestamp at which the commit is created. The hash of a commit is a hash of all this information. Since it is not possible to guess beforehand the timestamp at which the commit will occur, we cannot guess beforehand what that hash will be.

Please let us know if you have any questions related to this subject so we can help you with that.

Kind regards,
Caroline 

kamal.mohammed
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 25, 2021

Hi @Caroline R!

Thanks for the Reply. Ok Understood it.

I see that in the Pull request Page it's doing the check or giving diff with respect to base branch's latest commit and telling us about Any Merge Conflicts that may come up. So How is it is checking for Merge Conflicts that are coming up? If done Internally, can you give me an idea of how it is doing so?

 

Thanks,

Kamal

Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 26, 2021

Hi, Kamal

Bitbucket creates a temporary repository and creates a merge in the back end. This way we are able to show you what the final stage of the changes will look like once the merge is completed and if there are any conflicts.

I hope this helps, but do let me know if you have any questions.

Kind regards,
Caroline 

Like kamal.mohammed likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events