Skip to content

Broken textconf for git diff #35106

@Langenfeld

Description

@Langenfeld

Description

Custom diff for binary formats (docx, pdf, doc) via git textconf is not working anymore since gitea 1.24 (worked fine on 1.23). Instead of text content of the files, now some unicode gibberish is shown (see screenshot).

part of app.ini:

[git.config]
core.attributesfile = <GITEADATA>/home/.gitattributes
diff.pandoc.textconv =pandoc --to=markdown --wrap=none
diff.pandoc.binary=true
diff.pandoc.prompt =false
diff.catdoc.textconv =catdoc
diff.catdoc.binary=true
diff.pdftotext.textconv =sh -c 'pdftotext -layout -enc UTF-8 "$0" -'
diff.pdftotext.binary=true

.gitattributes

*.docx diff=pandoc
*.doc diff=catdoc
*.pdf diff=pdftotext

the call gitea uses to run the textconf looks somehow wired, as (e.g. for pandoc) the textconf command shows up twice:
/bin/sh -c pandoc --to=markdown --wrap=none "$@" pandoc --to=markdown --wrap=none theDoc.docx
The textconf command runs fine on console and produces the intended output.

Gitea Version

1.24.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Image

Git Version

2.39.5

Operating System

Debian 12

How are you running Gitea?

running from systemd with prebuild version from gitea.io

Database

MySQL/MariaDB

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions