[Feature] support disable repository programing language Detection #4880

Closed
opened 2025-11-02 06:05:58 -06:00 by GiteaMirror · 21 comments
Owner

Originally created by @ddatsh on GitHub (Feb 18, 2020).

as title

Originally created by @ddatsh on GitHub (Feb 18, 2020). as title
GiteaMirror added the issue/confirmedtype/enhancement labels 2025-11-02 06:05:58 -06:00
Author
Owner

@lafriks commented on GitHub (Feb 18, 2020):

Any reason/use case on why?

@lafriks commented on GitHub (Feb 18, 2020): Any reason/use case on why?
Author
Owner

@guillep2k commented on GitHub (Feb 18, 2020):

Related: https://github.com/go-gitea/gitea/issues/7953

@guillep2k commented on GitHub (Feb 18, 2020): Related: https://github.com/go-gitea/gitea/issues/7953
Author
Owner

@lunny commented on GitHub (Feb 19, 2020):

@lafriks Because they have small memory and don't think this feature is necessary. but have many big repo. And this feature spend many memory.

I also think this feature is just useful for public gitea instances or big enterprise gitea instances.

@lunny commented on GitHub (Feb 19, 2020): @lafriks Because they have small memory and don't think this feature is necessary. but have many big repo. And this feature spend many memory. I also think this feature is just useful for public gitea instances or big enterprise gitea instances.
Author
Owner

@stale[bot] commented on GitHub (Apr 19, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Apr 19, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@lunny commented on GitHub (Apr 19, 2020):

Related: #7953

No. That's not the same case. One is for UI language and this one is for repositories' programing languages detection.

@lunny commented on GitHub (Apr 19, 2020): > Related: #7953 No. That's not the same case. One is for UI language and this one is for repositories' programing languages detection.
Author
Owner

@dahrens commented on GitHub (May 28, 2020):

Because I have a typescript project that uses yarn for dependency management: my programming language is now YAML - since yarn.lock is usually huge :)

screenshot_from_2020-05-28_17-25-52

Ignoring specific files might also solve this.... Of course this is completely negligible...

@dahrens commented on GitHub (May 28, 2020): Because I have a typescript project that uses yarn for dependency management: my programming language is now YAML - since yarn.lock is usually **huge** :) ![screenshot_from_2020-05-28_17-25-52](https://user-images.githubusercontent.com/342831/83161332-97fd6d80-a108-11ea-9b5a-fdc7585ed88c.png) Ignoring specific files might also solve this.... Of course this is completely negligible...
Author
Owner

@silverwind commented on GitHub (May 28, 2020):

Should be per-repo. I think supporting the linguist gitattributes is a good idea which probably makes this an upstream issue.

@silverwind commented on GitHub (May 28, 2020): Should be per-repo. I think supporting the [linguist gitattributes](https://github.com/github/linguist#using-gitattributes) is a good idea which probably makes this an upstream issue.
Author
Owner

@stale[bot] commented on GitHub (Jul 27, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Jul 27, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@6543 commented on GitHub (Jul 27, 2020):

upstream issue: https://github.com/src-d/enry/issues/18 https://github.com/go-enry/go-enry/issues/27

@6543 commented on GitHub (Jul 27, 2020): upstream issue: ~~https://github.com/src-d/enry/issues/18~~ https://github.com/go-enry/go-enry/issues/27
Author
Owner

@silverwind commented on GitHub (Jul 27, 2020):

Copying my info from the other issue:


linguist supports various gitattributes to affect the language stats, I think we should too.

  • linguist-generated or maybe just generated for generated code
  • linguist-vendored or maybe just vendored for vendored code

Both have the effect that matching files will be excluded from language stats. There's more but I think these two are the most commonly used ones.

@silverwind commented on GitHub (Jul 27, 2020): Copying my info from the other issue: --- [linguist](https://github.com/github/linguist#using-gitattributes) supports various gitattributes to affect the language stats, I think we should too. - `linguist-generated` or maybe just `generated` for generated code - `linguist-vendored` or maybe just `vendored` for vendored code Both have the effect that matching files will be excluded from language stats. There's more but I think these two are the most commonly used ones.
Author
Owner

@stale[bot] commented on GitHub (Sep 26, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Sep 26, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@yurenchen000 commented on GitHub (Mar 4, 2023):

Any reason/use case on why?

Sometimes it gets wrong language,
maybe it is better to manually specify the value or disable it than the wrong value

@yurenchen000 commented on GitHub (Mar 4, 2023): > Any reason/use case on why? Sometimes it gets wrong language, maybe it is better to manually specify the value or disable it than the wrong value
Author
Owner

@delvh commented on GitHub (Mar 4, 2023):

You can use the .gitattributes to configure what file (type) gets what highlighter.

@delvh commented on GitHub (Mar 4, 2023): You can use the `.gitattributes` to configure what file (type) gets what highlighter.
Author
Owner

@yurenchen000 commented on GitHub (Mar 4, 2023):

You can use the .gitattributes to configure what file (type) gets what highlighter.

@delvh
thanks for your reply.

I want to Specify or Disable the language type here (in Repositories list page)
I wonder if this is possible?

gitea_lang_type

@yurenchen000 commented on GitHub (Mar 4, 2023): > You can use the `.gitattributes` to configure what file (type) gets what highlighter. @delvh thanks for your reply. I want to Specify or Disable the language type here (in Repositories list page) I wonder if this is possible? ![gitea_lang_type](https://user-images.githubusercontent.com/8458213/222925454-81e4a822-ce1c-45c8-b4ca-a2512f98e7ef.png)
Author
Owner

@delvh commented on GitHub (Mar 4, 2023):

Ah, you mean the global one.
Hmm…
Does https://github.com/github/linguist/blob/master/docs/overrides.md perhaps help?
I think -linguist-detectable or linguist-documentation sounds promising.

@delvh commented on GitHub (Mar 4, 2023): Ah, you mean the global one. Hmm… Does https://github.com/github/linguist/blob/master/docs/overrides.md perhaps help? I think `-linguist-detectable` or `linguist-documentation` sounds promising.
Author
Owner

@yurenchen000 commented on GitHub (Mar 4, 2023):

@delvh
Thanks for your patience, I'll try this doc.

I temporarily use sql to modify the database:

-- change one language in a repo
update language_stat set language='Markdown'  where id=THE_ID;

//this seems not right way. it's Repositories's languages and ratio info

@yurenchen000 commented on GitHub (Mar 4, 2023): @delvh Thanks for your patience, I'll try this doc. I temporarily use sql to modify the database: ```sql -- change one language in a repo update language_stat set language='Markdown' where id=THE_ID; ``` //this seems not right way. it's Repositories's languages and ratio info
Author
Owner

@silverwind commented on GitHub (Mar 6, 2023):

I doubt we support all linguist-* attributes yet, but we do at least support some like linguist-language and linguist-vendored.

@silverwind commented on GitHub (Mar 6, 2023): I doubt we support all `linguist-*` attributes yet, but we do at least support some like `linguist-language` and `linguist-vendored`.
Author
Owner

@King555a commented on GitHub (Apr 3, 2023):

Are there any plans to support linguist-documentation in .gitattributes?

@King555a commented on GitHub (Apr 3, 2023): Are there any plans to support `linguist-documentation` in .gitattributes?
Author
Owner

@silverwind commented on GitHub (Apr 4, 2023):

I'm not up to date where these linguist attributes are currently supported (e.g. gitea vs. go-enry dependency), but there might be a dependency on getting it in go-enry first:

https://github.com/go-enry/go-enry/issues/27

@silverwind commented on GitHub (Apr 4, 2023): I'm not up to date where these linguist attributes are currently supported (e.g. gitea vs. go-enry dependency), but there might be a dependency on getting it in go-enry first: https://github.com/go-enry/go-enry/issues/27
Author
Owner

@silverwind commented on GitHub (Feb 15, 2024):

linguist-language is supported since a while ago.

@silverwind commented on GitHub (Feb 15, 2024): `linguist-language` is supported since a while ago.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 28, 2024):

Automatically locked because of our CONTRIBUTING guidelines

@github-actions[bot] commented on GitHub (Feb 28, 2024): Automatically locked because of our [CONTRIBUTING guidelines](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#issue-locking)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4880