Open sergey-ostapenko opened 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.
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.
@buddyspike By CI perspective, it will miss building some targets in cases like
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
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.