-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
git on Gitea ignores the repo's .gitattributes and uses its own #8394
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
Comments
|
@guillep2k I am aware of this I will clarify my post to make this clearer |
.gitattributes is only interrogated by non bare repositories. We use (temporary) bare repositories for almost all of our work - merge is the only place left that does (partial) checkouts but thank you because I now need to check I can't get a merge containing an appropriately malicious .gitattributes to do anything horrible. Edit: thankfully it can't.
In bare repositories if you want to adjust the gitattributes file you need to edit the Now in our case because we use cleaned temporary repositories I'm fairly certain that when we make these clones the The only ways to change this are:
I'm not certain how much it worth making these sorts of changes if the global config works. Looking again at the security considerations of this, I don't think any of these techniques would open Gitea up to security holes in general - however, you should be aware that diff commands need to tolerate arbitrary inputs safely. Edit: I managed to confuse gitattributes and gitconfig here a bit so I've rewritten this comment. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
This issue has been automatically closed because of inactivity. You can re-open it if needed. |
[x]
):Description
Not really sure if this is a bug or a feature. But if a repo has a .gitattributes file the git user running on gitea will ignore it when running functions such as
git diff
.E.g lets say on the Gitea instance we have:
git config --global --edit
To the end of the file we add:
And the repo contains a .gitattributes with contents

*.docx diff=pandoc
Ensuring pandoc is installed we get:
However if we set the .gitattributes globally on the Gitea instance we can run

git config --global core.attributesfile <path to some global .gitattributes file>
and point it at a file containing*.docx diff=pandoc
We get the desired result
.gitattributes is used for customising more than just how diffs are rendered. So I imagine this bug could have further implications.
The text was updated successfully, but these errors were encountered: