Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

pre-commit hook: How to find the list of files being merged and the files changed locally

saiaprameyarao
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!
July 24, 2019

Hi,

I am developing a pre-commit hook locally and wanted to check if the files are py2-py3 compatible. If not i throw an error saying commit criteria not met.

 

Problem faced:

I see people getting error for the files that they have not touched. This is because those files came in because of the merge.

 

QUERY:

Can you please let me know how to get the list of files that got merged and the files which were touched by the user (changed because of the merge conflict or some local changes)

Using this i can only run my pre-commit checks on the files which the user modified and not those which came in as merge.

 

Please let me know.

 

1 answer

0 votes
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 24, 2019

Hi @saiaprameyarao

Is your question about Bitbucket Cloud or Bitbucket Server?

Cheers,
Daniil

Aron Gombas _Midori_
Community Champion
August 5, 2019

Honestly, if it is a "pre-commit" hook, then it is a Git question, not a Bitbucket one. At least IMO.

Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 5, 2019

Indeed. I was thinking about server-side hooks because of the reference to merges.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events