Skip to content

git on Gitea ignores the repo's .gitattributes and uses its own #8394

@HarvsG

Description

@HarvsG
  • Gitea version (or commit ref): 1.9
  • Git version: 2.17.1
  • Operating system: Ubuntu 18.04
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

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:

[diff "pandoc"]
     textconv=pandoc --to=markdown
     prompt = false
[alias]
     wdiff = diff --word-diff=color --unified=1

And the repo contains a .gitattributes with contents
*.docx diff=pandoc
Ensuring pandoc is installed we get:
Screenshot 2019-10-06 at 18 25 39

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
Screenshot 2019-10-06 at 18 23 11

.gitattributes is used for customising more than just how diffs are rendered. So I imagine this bug could have further implications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/stalereviewed/wontfixThe problem described in this issue/fixed in this pull request is not a problem we will fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions