Tag name rules #12990

Open
opened 2025-11-02 10:27:03 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @sadorowo on GitHub (May 13, 2024).

Feature Description

Idea

I think it would be great if Gitea had something like tag name rules. This would be the exact opposite of tag protection - repository administrators will be able to set up, for example, a regular expression or glob, to match tags.

If tag name wouldn't match, it will be rejected.

Why not use tag protection?

Someone will say:
We have already tag protection. Assume you have regular expression like this:

^\Av\d+\.\d+\.\d+\z$

Just use negative lookahead, and slightly modify your regex...

^(?!\Av\d+\.\d+\.\d+\z).*$

...and everything will be fine - no need to create another feature!

Unfortunately this is not possible, because we can't use negative lookahead - Go regexp uses RE2 syntax, not PCRE.

Conclusion

  • we would be sure that the tag names are correct
  • it's not that hard to implement, because you have already done tag protection
  • GitHub doesn't have this 👀

Screenshots

image

Originally created by @sadorowo on GitHub (May 13, 2024). ### Feature Description ### Idea I think it would be great if Gitea had something like tag name rules. This would be the exact opposite of tag protection - repository administrators will be able to set up, for example, a regular expression or glob, to match tags. If tag name wouldn't match, it will be rejected. ### Why not use tag protection? Someone will say: We have already tag protection. Assume you have regular expression like this: ```regexp ^\Av\d+\.\d+\.\d+\z$ ``` Just use negative lookahead, and slightly modify your regex... ```regexp ^(?!\Av\d+\.\d+\.\d+\z).*$ ``` ...and everything will be fine - no need to create another feature! Unfortunately **this is not possible**, because we can't use negative lookahead - Go [regexp](https://pkg.go.dev/regexp) uses RE2 syntax, not PCRE. ### Conclusion - [x] we would be sure that the tag names are correct - [x] it's not that hard to implement, because you have already done tag protection - [x] GitHub doesn't have this 👀 ### Screenshots ![image](https://github.com/go-gitea/gitea/assets/97941280/f83f4e94-b5bf-4950-b683-c2295ac34dd5)
GiteaMirror added the type/proposal label 2025-11-02 10:27:03 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12990