Ignore files in diff with .gitattributes#16250
Ignore files in diff with .gitattributes#16250KN4CK3R wants to merge 2 commits intogo-gitea:mainfrom
Conversation
|
nope. This is not the way. git check-attr is the correct tool. |
The diff is initially hidden like on Github. The diff is not delayed because that's how Gitea works at the moment. See https://github.blog/2016-12-06-how-we-made-diff-pages-3x-faster/ how Github may do it. |
Yes, the correct tool but it does not work with bare repos. See https://gitlab.com/gitlab-org/gitlab-foss/-/issues/2315#note_3339982 and the following posts. |
False. We already use git check-attr in bare repositories and have done for 2 YEARS. Please look at: https://github.com/go-gitea/gitea/blob/main/modules/git/repo_attribute.go There is already an aborted partial attempt at getting the language from the repo attributes in #14833 which is almost there and if I wasn't so busy fixing other things I'd have fixed it and had it already. |
|
Cool, don't know why it didn't work for me yesterday 🤷♂️ |
|
It should also check enry.IsGenerated |
…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
|
replaced by #16773 |

fixes #12653
close #16262
first step for #14786, #14528
This PR adds a

.gitattributesparser to Gitea. It works like on Gitlab and "caches" the.gitattributefile from the root of the default branch inrepo.git/info/attributes. The diff supports now thelinguist-generatedkeyword and hides these file in the output.