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 Request]: Ignore directories from language statistics bar #14786

Closed
1 of 4 tasks
spacekookie opened this issue Feb 24, 2021 · 4 comments · Fixed by #16773
Closed
1 of 4 tasks

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

spacekookie opened this issue Feb 24, 2021 · 4 comments · Fixed by #16773
Labels
type/feature Completely new functionality. Can only be merged if feature freeze is not active.

Comments

@spacekookie
Copy link

  • 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.

@lunny
Copy link
Member

lunny commented Feb 24, 2021

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

@spacekookie
Copy link
Author

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

@lafriks
Copy link
Member

lafriks commented Feb 24, 2021

yes, this is not currently supported

@spacekookie
Copy link
Author

spacekookie commented Feb 24, 2021

@lafriks

yes, this is not currently supported

[Feature Request]

@noerw noerw added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Feb 28, 2021
zeripath added a commit that referenced this issue Sep 9, 2021
…guage stats and diffs (#16773)

Replaces #16262
Replaces #16250
Replaces #14833

This PR first implements a `git check-attr` pipe reader - using `git check-attr --stdin -z --cached` - taking account of the change in the output format in git 1.8.5 and creates a helper function to read a tree into a temporary index file for that pipe reader.

It then wires this in to the language stats helper and into the git diff generation.

Files which are marked generated will be folded by default.

Fixes #14786
Fixes #12653
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
4 participants