getting last commit before push of a specific build Edited


sometimes when working a user accumulates multiple local commits before pushing to the origin.

in that case, BITBUCKET_COMMIT will only point to the last one.

is it possible to somehow get the range of commits that triggered the build?

it is necessary for my team in order to determine which services changed during the last update and only build them.


in addition to that, better support for mono-repos could be really great.


1 answer

Ough, sorry, I thought this is discussion, not answer, so don't treat my post as answer please.


It's not totally correct heading of question. It's not commit range is required but the last commit hash BEFORE push happen.

So, idea is to check, manipulate only with files newely delivered by push triggered build. To be able to use something like `git diff --names-only ${BITBUCKET_PREVIOUS_COMMIT} HEAD`. Such functionality is highly demanded for CI server. Thanks.

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

682 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot