-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Closed
Labels
issue/bountyThis issue has a bounty associated. Whoever opens a PR and gets it merged can claim the bounty.This issue has a bounty associated. Whoever opens a PR and gets it merged can claim the bounty.type/enhancementAn improvement of existing functionalityAn improvement of existing functionality
Description
Github uses Linguist for code analysis in its repositories, and resulting from that introduced a nifty feature in its .gitattributes definitions: linguist-generated
. This attribute can be used to exclude specific file types from diffs, code reviews, and hide it from showing in the file listing.
I've found that to be invaluable to working with Unity3D in order to keep .meta and .prefab files from cluttering code reviews. It would be cool to have a similar feature in Gitea
mattdavis90, kdumontnu and jtran
Metadata
Metadata
Assignees
Labels
issue/bountyThis issue has a bounty associated. Whoever opens a PR and gets it merged can claim the bounty.This issue has a bounty associated. Whoever opens a PR and gets it merged can claim the bounty.type/enhancementAn improvement of existing functionalityAn improvement of existing functionality
Activity
mattdavis90 commentedon Feb 5, 2021
This would be a great feature. An alternative to the
linguist-generated
attribute, might be having gitea observe the-diff
and-merge
attributes.Edit: Reading around and testing on my own gitea setup it looks as though the
.gitattributes
file may not be available within bare repos - libgit2/libgit2#3676kdumontnu commentedon Jun 24, 2021
mattdavis90 commentedon Jun 25, 2021
@KN4CK3R You beat me to it, with a much cleaner solution 😄 Was fun to play around though.
My less elegant approach is here in case there is anything of use.
It attempts to find the
.gitattributes
file on the current commit and temporarily stores it in<repo>/info/attributes
so that it is available to thegit diff
command later. A little hacky, and I'm sure there is probably an issue if two API calls come in together.Use git attributes to determine generated and vendored status for lan…