Closed ennioVisco closed 1 year ago
Hi @ennioVisco ,
no, there's no such option as of now. What you can use, at most, is substitutions so you can mangle each line by using regular expressions.
Would this be a feature for you?
Hi @ennioVisco ,
no, there's no such option as of now. What you can use, at most, is substitutions so you can mangle each line by using regular expressions.
Would this be a feature for you?
I was thinking about the substitutions indeed. I wouldn't say I need this feature. Perhaps a substitution is fine as of now, and maybe one day a preset can be made available if others also seem to prefer this option 😊
Wait @ennioVisco , there's a better option than substitutions. . Regular expressions need a try but you can achieve that with standard features.
Use a custom changelog template and use some function like capture
to mangle the commit row title.
For example, replace the default changelog template lines:
{{#commits}}
* [{{#short5}}{{SHA}}{{/short5}}] {{message.shortMessage}} ({{authorAction.identity.name}})
with:
{{#commits}}
* [{{#short5}}{{SHA}}{{/short5}}] {{#capture expression="(?<type>[a-zA-Z0-9_]+)(!)?(\((?<scope>[a-z ]+)\))?:( (?<title>.+))" group="title"}}{{message.shortMessage}}{{/capture}} ({{authorAction.identity.name}})
This function extracts the title
named group from the {{message.shortMessage}}
so it's exactly what you need here. Again, I haven't tested this expression but all the features are there.
Wait @ennioVisco , there's a better option than substitutions. . Regular expressions need a try but you can achieve that with standard features.
Use a custom changelog template and use some function like
capture
to mangle the commit row title.For example, replace the default changelog template lines:
{{#commits}} * [{{#short5}}{{SHA}}{{/short5}}] {{message.shortMessage}} ({{authorAction.identity.name}})
with:
{{#commits}} * [{{#short5}}{{SHA}}{{/short5}}] {{#capture expression="(?<type>[a-zA-Z0-9_]+)(!)?(\((?<scope>[a-z ]+)\))?:( (?<title>.+))" group="title"}}{{message.shortMessage}}{{/capture}} ({{authorAction.identity.name}})
This function extracts the
title
named group from the{{message.shortMessage}}
so it's exactly what you need here. Again, I haven't tested this expression but all the features are there.
Thanks, I am already using a custom template, so this is a good idea, I didn't think about it!
One question though, just because I am not sure whether it is a bug:
by using your line I get this: https://github.com/ennioVisco/webmonitor/releases/tag/v1.1.0-internal.1.beta.12 (notice the broken commit links)... Could it be the capturing does not happen just on the inner message.shortMessage
but changes the whole line?
That's weird, I need to test.
Are you using the Java/Gradle or the Go/Command Line version?
There is a difference with the latest release, where {{SHA}}
was previously case insensitive while it now needs to be lower case {{sha}}
. Fixing this it works as expected
I was curious whether there is a way (I didn't get it from the docs) to remove the prefixes of the commits complying to the commits policy (I'm thinking in particular about the prefixes as shown in the following screenshot from
nyx
releases):