mbtproject / mbt

The most flexible build tool for monorepo
https://github.com/mbtproject
Apache License 2.0
219 stars 35 forks source link

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

Open sergey-ostapenko opened 6 years ago

sergey-ostapenko commented 6 years ago

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 commented 6 years ago

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 commented 5 years ago

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 commented 3 years ago

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

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