Files shown as vendored in PR/FilesChanged tab

Hey folks,
just noticed some files in a repo marked as vendored and always show the complete file replaced/marked as diff:

image

Does anyone know what vendored means and how it gets detected / configured?

I’m not sure if this relates to the fact the it always shows me the complete file as diff on a pull request? - I seems like the whitespace detection is different here. I can switch the whitepace option and it works again:

image

btw: I didn’t find any non printable chars / encoding changes / EOL or BOM changes in these files…

vendored is an attribute given by GitHub - go-enry/go-enry: A faster file programming language detector.
We simply pass a file there, and it outputs, among other things, that.
You should be able to control the attributes given to files from the .gitattributes.


I think the second part is not a bug, because I can see both L3 and L7 being changed.
As Gitea should render the changed lines ± 3 three lines by default, this means that with these two changes, the whole file should be rendered.

Thanks for helping with the vendored files detection. I found the definition in the lingust vendor detection.


You’re right, my example wasn’t very helpfull. I also saw a PR today, where this file had 270 lines/items. Two lines where added in the middle of the file and the diff showed the complete as replaced with the option Show all changes. :thinking:

I can think of one more possible cause:
Could the PR where you’ve seen this change the line ending of these files?
This typically happens when a Windows user commits on a repo maintained by Linux/ apple users, or vice versa.
The problem comes from the fact that Windows uses \r\n as the ending of a line while everything else uses only \n.
Thus, it is expected behavior that everything is “changed” when whitespace changes are shown.

Well I already checked the system and global git config. We disable the core.autocrlf=false config. I also defined a .editorconfig in our repos and templates + a local .vscode setting.

Bbut let me check it again. Maybe my colleagues got it mixed up.