Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add easier way to build last commit in current branch #81

Open
sergey-ostapenko opened this issue May 11, 2018 · 3 comments
Open

Add easier way to build last commit in current branch #81

sergey-ostapenko opened this issue May 11, 2018 · 3 comments

Comments

@sergey-ostapenko
Copy link
Contributor

sergey-ostapenko commented May 11, 2018

Can we add command that will build last commit in current branch?
Like one of the following:

mbt build last
mbt build commit last
mbt build commit HEAD

Alternatively we can just resolve aliases like HEAD, HEAD^, HEAD~N in all execution scenarios.

@buddhike
Copy link
Member

I think this is a great idea. It's similar to the experience with git. I guess HEAD^ and HEAD~N is more natural from that perspective.

@saeid-ir
Copy link

saeid-ir commented Nov 4, 2018

I think it's very simple to implement this.
All git HEAD have a top commit that can be achieved by running git rev-parse HEAD.
So the build commit can be reuse with --from and -- to when a HEAD commit SHA achieved.

@pratikbin
Copy link

pratikbin commented Jun 19, 2021

@BuddySpike By CI perspective, it will miss building some targets in cases like

  • If multiple commits are merged, then HEAD^1 only build based on last commit changed targets and for HEAD^N, how can we figure out what is N in CI ,

I guess HEAD^ and HEAD~N is more natural from that perspective.

in this case, we can keep pointer file containing last successful mbt run commit sha and compare it with current
e.g. mbt build diff --to $(git rev-parse HEAD) --from $(head -n1 pointer)

I think it's very simple to implement this.
All git HEAD have a top commit that can be achieved by running git rev-parse HEAD.
So the build commit can be reuse with --from and -- to when a HEAD commit SHA achieved.

works for me at least

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants