[Feature Request]: Ignore directories from language statistics bar #6918

Closed
opened 2025-11-02 07:11:05 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @spacekookie on GitHub (Feb 24, 2021).

  • Gitea version (or commit ref): 1.13.0

  • Git version: N/A

  • Operating system: NixOS/ Linux (systemd)

  • Database (use [x]):

    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io: N/A

  • Log gist: N/A

Description

The linguist project used by GitHub (and GitLab) supports .gitattributes files in the repository tree to exclude certain directories or files. This is very useful when vendoring large code-bases.

I operate a monorepo for all my code, which contains subtrees for many of my project dependencies. Because of this the language bar is not representative of the languages I actually write.

It would be great if there was some way of telling gitea to ignore certain directories for the purpose of language statistics. I had a look at the code, but I really don't know Go and couldn't figure out how to implement it.

It doesn't neccessarily have to be the same .gitattributes format that linguist uses (it would be cool though!). It would already be enough if there was a list of "ignore paths" in the project settings screen.

Anyway, let me know what you think.

Originally created by @spacekookie on GitHub (Feb 24, 2021). - Gitea version (or commit ref): 1.13.0 - Git version: N/A - Operating system: NixOS/ Linux (systemd) - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: N/A - Log gist: N/A ## Description The `linguist` project used by GitHub (and GitLab) supports `.gitattributes` files in the repository tree to exclude certain directories or files. This is very useful when vendoring large code-bases. I operate a monorepo for all my code, which contains subtrees for many of my project dependencies. Because of this the language bar is not representative of the languages I actually write. It would be great if there was some way of telling gitea to ignore certain directories for the purpose of language statistics. I had a look at the code, but I really don't know Go and couldn't figure out how to implement it. It doesn't neccessarily have to be the same `.gitattributes` format that `linguist` uses (it would be cool though!). It would already be enough if there was a list of "ignore paths" in the project settings screen. Anyway, let me know what you think.
GiteaMirror added the type/feature label 2025-11-02 07:11:05 -06:00
Author
Owner

@lunny commented on GitHub (Feb 24, 2021):

So the .gitattributes should be in the root path of the repository?

@lunny commented on GitHub (Feb 24, 2021): So the `.gitattributes` should be in the root path of the repository?
Author
Owner

@spacekookie commented on GitHub (Feb 24, 2021):

I think that's how linguist handles them, yea.

This is an example from one of my projects: https://git.qaul.org/qaul/qaul/-/blob/develop/.gitattributes

The syntax is otherwise documented here: https://github.com/github/linguist#using-gitattributes

@spacekookie commented on GitHub (Feb 24, 2021): I think that's how `linguist` handles them, yea. This is an example from one of my projects: https://git.qaul.org/qaul/qaul/-/blob/develop/.gitattributes The syntax is otherwise documented here: https://github.com/github/linguist#using-gitattributes
Author
Owner

@lafriks commented on GitHub (Feb 24, 2021):

yes, this is not currently supported

@lafriks commented on GitHub (Feb 24, 2021): yes, this is not currently supported
Author
Owner

@spacekookie commented on GitHub (Feb 24, 2021):

@lafriks

yes, this is not currently supported

[Feature Request]

@spacekookie commented on GitHub (Feb 24, 2021): @lafriks > yes, this is not currently supported > [Feature Request]
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6918