dsmiley commented on code in PR #3818:
URL: https://github.com/apache/solr/pull/3818#discussion_r2469439271


##########
gradle/changelog.gradle:
##########
@@ -31,17 +31,17 @@ task writeChangelog {
     def nick = githubId ? "\n    nick: ${githubId}" : ""
     def asfId = providers.gradleProperty("user.asfid").getOrElse(null)
     def asfIdUrl = asfId ? "\n    url: 
https://home.apache.org/phonebook.html?uid=${asfId}"; : ""
-    def gitBranch = 'git rev-parse --abbrev-ref HEAD'.execute().text.trim()
-    def jiraMatcher = gitBranch.toUpperCase() =~ /SOLR-\d\d\d+/
-    def jiraRef = jiraMatcher ? jiraMatcher[0] : "SOLR-XXXX"
+    def gitBranch = 'git rev-parse --abbrev-ref 
HEAD'.execute().text.trim().replaceFirst(/^.*\//, "")
+    def jiraMatcher = gitBranch =~ /(?i)SOLR-\d\d\d+/
+    def jiraRef = jiraMatcher ? jiraMatcher[0].toUpperCase() : "SOLR-XXXX"

Review Comment:
   Use the same regexp as further below; case insensitive match.  then 
normalize what we find to uppercase



##########
gradle/changelog.gradle:
##########
@@ -31,17 +31,17 @@ task writeChangelog {
     def nick = githubId ? "\n    nick: ${githubId}" : ""
     def asfId = providers.gradleProperty("user.asfid").getOrElse(null)
     def asfIdUrl = asfId ? "\n    url: 
https://home.apache.org/phonebook.html?uid=${asfId}"; : ""
-    def gitBranch = 'git rev-parse --abbrev-ref HEAD'.execute().text.trim()
-    def jiraMatcher = gitBranch.toUpperCase() =~ /SOLR-\d\d\d+/
-    def jiraRef = jiraMatcher ? jiraMatcher[0] : "SOLR-XXXX"
+    def gitBranch = 'git rev-parse --abbrev-ref 
HEAD'.execute().text.trim().replaceFirst(/^.*\//, "")

Review Comment:
   this specific line is the substance.  I also tweaked some other things...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to