Skip to content

Mirror directory names have the digits stripped from the repository name #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pgrenaud opened this issue Mar 29, 2023 · 0 comments

Comments

@pgrenaud
Copy link

No idea why it was made this way in the first place, but this regex strips digits from the repository name before creating the directory for the git mirror.

(parsed_url.host + parsed_url.path.gsub(/\.git$/, '')).gsub(/[\\\/]+/, '_').gsub(/[^A-Za-z._-]/, '')[0..64]

https://github.com/eXolnet/redmine_git_mirror/blob/master/app/models/repository/git_mirror.rb#L120

I would really help reading the directory names if they were matching the their name on GitHub. And since GitHub allow digits, we probably should review the regex. I was not able to find an official source from GitHub stating that, but I found a few place mentioning it.

Repository name should contain only alphanumeric, dash ('-'), underscore ('_') and dot ('.') characters.

go-gitea/gitea#13943

it looks like github allows [A-Za-z0-9_.-], and transforms all other characters to "-".

https://stackoverflow.com/a/59082561

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant