[Rev 01] RFR: 304: Squash additional commits into merge commits for merge PRs

Erik Helin ehelin at openjdk.java.net
Thu Mar 19 13:40:49 UTC 2020


On Thu, 19 Mar 2020 10:03:45 GMT, Robin Westberg <rwestberg at openjdk.org> wrote:

>> bots/pr/src/main/java/org/openjdk/skara/bots/pr/CheckRun.java line 174:
>> 
>>> 173:                 }
>>> 174:                 if (mergeCommitIndex >= commits.size() - 1) {
>>> 175:                     ret.add("A Merge PR must contain a merge commit.");
>> 
>> What if you do a "Merge PR" with a single trivial merge just to merge to branches (that have identical commits). Too
>> narrow of a use case to think about?
>
> Not sure if that is something we would need to support, not even sure how to create such a merge commit. :)

Ok, then forget about this comment ��

>> bots/pr/src/main/java/org/openjdk/skara/bots/pr/PullRequestInstance.java line 153:
>> 
>>> 152:
>>> 153:         localRepo.checkout(commits.get(mergeCommitIndex).hash(), true);
>>> 154:         localRepo.squash(headHash);
>> 
>> Check that `mergeCommitIndex < commits.size()` before and otherwise throw an exception?
>
> That should never happen (tm), the actual merge depends on jcheck passing first so we can assume that the PR is
> well-formed.

Ok, sounds good!

-------------

PR: https://git.openjdk.java.net/skara/pull/519


More information about the skara-dev mailing list