Would squashing be possible?


#1

As indicated in What is the `staging.tmp` branch used for?, bors apparently only uses the GitHub API for creating merge commits. Would it similarly be possible to squash all the commits into one using the GitHub API, or does that not exist?

I’d envision a syntax like

bors r+ squash

or similar.


#2

Previous conversation about that topic:

Basically, it’s possible to squash commits using the GitHub API. The hard part is getting the PR to be marked as “merged” when we want it to be marked as such:

  • If bors uses the “merge PR” API to squash-and-merge the commits, then the PR will be marked as “merged” before we are done testing it.
  • If it uses the “Git Data” API to squash-and-merge the commits, then the PR will never be marked as “merged.” Alternatively, we could squash the commits, push the squashed result to the PR, then push to master, but that requires the user to have the “[ ] allow project contributors to modify this PR” checkbox turned on.

#3

It’d be great to have this in one way or another. To me, the second solutions sounds better. Can I post this as a feature request somewhere?


#4

That issue 194 kinda already is that, isn’t it?


#5

True. :slight_smile:


#6

An other alternative is to tag the squash commit as “closes #<pr_number>”


#7

That marks it as closed, with the red badge. I want it marked as merged, with the purple badge, if it’s at all possible.