RFR: 1539: Allow dots in merge PR branch name

Erik Joelsson erikj at openjdk.org
Thu Aug 11 14:09:17 UTC 2022


On Thu, 11 Aug 2022 13:58:52 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> This patch makes it possible to create merge style PRs based on branches with periods `.` in the branch name. We quite commonly put periods in branch names as we like to base branches on version strings.
>> 
>> Modified an existing test to cover this case.
>
> forge/src/main/java/org/openjdk/skara/forge/PullRequestUtils.java line 42:
> 
>> 40:     }
>> 41: 
>> 42:     private final static Pattern mergeSourcePattern = Pattern.compile("^Merge ([-/.\\w:+]+)$");
> 
> This will match any character, which may not be what you intend. Shouldn't that be `\.` instead of just `.`?

My understanding is that the only characters you need to escape inside a character class are `^`, `-`, `]` or ``, everything else is a literal. Also Intellij gave me a warning when I tried to escape it saying it was unnecessary.

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

PR: https://git.openjdk.org/skara/pull/1355


More information about the skara-dev mailing list