Skip to content
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

Feature suggestion #14528 (language detection override for new unknown ones) doesn't seem to be working #21377

Closed
ell1e opened this issue Oct 8, 2022 · 2 comments · Fixed by #21403
Labels
issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea

Comments

@ell1e
Copy link

ell1e commented Oct 8, 2022

Description

I just tested with Gitea 1.17.2, and the feature suggestion #14528 doesn't seem to be working even though I think the comments on the issue suggest it should be.

Basically, make a new repo, add some non-empty test file that ends in a new unused file extension like .bla, then add a .gitattributes line:

*.bla linguist-language=BlaLanguage

The expected result is that the lines of your .bla file get counted and show up as a new entry on the language bar of the repository labelled BlaLanguage. This is however not the case, it just seems to be ignored.

Gitea Version

1.17.2

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

See https://try.gitea.io/blablablablab/blatest

Git Version

No response

Operating System

No response

How are you running Gitea?

It's someone else's instance

Database

No response

@ell1e ell1e added the type/bug label Oct 8, 2022
@Drugan-qc
Copy link

Same issue on my private instance with 1.16.9

@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 10, 2022

It works until a certain point. The language gets detected

BlaLang: type unknown
Python: type programming

and sadly filtered out some lines later

// filter special languages unless they are the only language
if len(sizes) > 1 {
for language := range sizes {
langtype := enry.GetLanguageType(language)
if langtype != enry.Programming && langtype != enry.Markup {
delete(sizes, language)
}
}
}

@KN4CK3R KN4CK3R added issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea and removed type/bug labels Oct 10, 2022
lunny added a commit that referenced this issue Oct 29, 2022
Fixes #21377

This marks all "defined" languages in the `.gitattributes` file so they
are not removed if they are not of type `programming` or `markup`.


![grafik](https://user-images.githubusercontent.com/1666336/194942021-1e641b60-bb8a-49c6-9a1c-413e7c4ba17d.png)

Co-authored-by: zeripath <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
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 a pull request may close this issue.

3 participants