Skip to content

Conversation

@DblK
Copy link
Member

@DblK DblK commented Nov 3, 2016

Migration of Gogs PR #3848

@DblK
Copy link
Member Author

DblK commented Nov 3, 2016

@0xBAADF00D can you make your original PR here instead of in Gogs repository?

@thibaultmeyer
Copy link
Contributor

@DblK I can but i'm forced to create another PR because this (PR #43) is owned by you (DblK:migration-FixSHA).

What the point ? why fork GOGS ?

@DblK
Copy link
Member Author

DblK commented Nov 3, 2016

@0xBAADF00D yeah, go ahead a create new PR since you did the work.
I will closed the three I made mirroring yours.

To answer your question about why to fork, I would suggest your to pay a visit on gitter (https://gitter.im/go-gitea/gitea) to discuss.

@DblK DblK closed this Nov 3, 2016
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
@delvh delvh added issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea and removed reviewed/invalid labels Oct 7, 2023
pieer added a commit to ikigau/gitea that referenced this pull request Oct 27, 2025
…idation logic

The frontend generateRepoNameFromSubject() function was inconsistent with
the backend validation rules defined in models/repo/repo.go.

Backend validation rules (from IsUsableRepoName):
- Pattern: ^[-.\\w]+$ (hyphen, dot, word chars: a-zA-Z0-9_)
- Invalid: consecutive dots (2+)
- Reserved names: ".", "..", "-"
- Reserved patterns: *.wiki, *.git, *.rss, *.atom

Changes made to align frontend with backend:

1. Added consecutive dot collapsing
   - Backend rejects names with 2+ consecutive dots
   - Frontend now collapses multiple dots to single dot
   - Example: "my...repo" → "my.repo"

2. Added reserved pattern handling
   - Backend rejects *.wiki, *.git, *.rss, *.atom
   - Frontend now appends "-repo" suffix to avoid these
   - Example: "my-project.git" → "my-project.git-repo"

3. Enhanced comments to reference backend validation
   - Documents which backend rules are being matched
   - Makes maintenance easier by linking frontend/backend

4. Kept existing beneficial frontend logic
   - Consecutive hyphen collapsing (improves readability)
   - Leading/trailing character removal (prevents reserved names)
   - These don't conflict with backend validation

This ensures users get immediate feedback that matches backend
validation, preventing confusing errors after form submission.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants