You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of adding some more convoluted and additional code to Git
Version specifically to handle tags with suffixes, it instead now uses a
new approach when handling tag prefix.
tl;dr default filter `*-*` is now `[[:digit"]]**`.
Even since before Git Version, it was established through the use of
`Character#isDigit` that all tags should, in some way, include a valid
number to convey the version. Prior to Git Version 0.4, when checking
for tags without a tag prefix, the filter would simply check if the tag
didn't have any dashes in it. Since the tag prefix should only ever
remain a prefix, I've simplified this to instead check for a digit.
JGit's glob filtering uses the same digit detection as
`Character#isDigit`.
Now, tag prefixes prepend the default filter with `TAG_PREFIX[-v]*`.
This makes the filterer search for the defined tag prefix while
optionally accounting for any extra dashes or v's (for legacy branches
that use `v1.0` or something). So, the contract is now that a tag must
always include a digit for it to be included in versioning.
@@ -147,7 +145,7 @@ private Info calculateInfo(CommitCountProvider commitCountProvider) {
147
145
}).call();
148
146
149
147
if (describedTag == null)
150
-
thrownewRefNotFoundException("Tag not found! Tag prefix: %s, Filters: %s".formatted(this.tagPrefix, String.join(", ", this.filters)));
148
+
thrownewRefNotFoundException("Tag not found! A valid tag must include a digit at the minimum! Tag prefix: %s, Filters: %s".formatted(this.tagPrefix, String.join(", ", this.filters)));
151
149
152
150
vardesc = Util.rsplit(describedTag, "-", 2);
153
151
@@ -159,22 +157,16 @@ private Info calculateInfo(CommitCountProvider commitCountProvider) {
159
157
returntarget != null ? target.getName() : null;
160
158
}); // matches Repository.getFullBranch() but returning null when on a detached HEAD
161
159
162
-
varret = Info.builder();
163
-
ret.tag = Util.make(() -> {
164
-
vart = desc[0].substring(this.tagPrefix.length());
0 commit comments