Skip to content

Conversation

@ClaudioHoffmann
Copy link
Contributor

The fix for git-for-windows/git#5641 broke diffs for plaintext DOC and DOT files:

$ echo Test > test.doc
$ git add test.doc
$ git diff --cached
E: unsupported filetype test.doc

Since file correctly identifies the mimetype of such files as text/plain, this can be fixed by simply covering this case and printing the file content as it was done previously.

The fix for git-for-windows/git#5641 broke
diffs for plaintext DOC and DOT files:

    $ echo Test > test.doc
    $ git add test.doc
    $ git diff --cached
    E: unsupported filetype test.doc

Since `file` correctly identifies the mimetype of such files as
`text/plain`, this can be fixed by simply covering this case and
printing the file content as it was done previously.

Signed-off-by: Claudio Hoffmann <c.hoffmann@dev-threads.de>
@dscho
Copy link
Member

dscho commented Jun 23, 2025

Thank you for the contribution! The checksums were incorrect, though, and unfortunately I lack the permission to fix it in this PR, therefore I opened #628.

@dscho dscho merged commit d90bdff into git-for-windows:main Jun 23, 2025
5 of 7 checks passed
rimrul added a commit to rimrul/build-extra that referenced this pull request Jan 8, 2026
Our astextplain helper used to pass through empty files and plaintext with the
an expected extension. WHen we changed it to work based on mimetype
rather than a predefined list of extensions in git-for-windows#624, both those passthroughs got
lost. Plaintext passthrough has been restored in git-for-windows#626, but passthrough
of empty files is still missing. Restore this functionality.

This fixes git-for-windows/git#5977

Signed-off-by: Matthias Aßhauer <mha1993@live.de>
rimrul added a commit to rimrul/build-extra that referenced this pull request Jan 8, 2026
Our astextplain helper used to pass through empty files and plaintext with the
an expected extension. WHen we changed it to work based on mimetype
rather than a predefined list of extensions in git-for-windows#624, both those passthroughs got
lost. Plaintext passthrough has been restored in git-for-windows#626, but passthrough
of empty files is still missing. Restore this functionality.

This fixes git-for-windows/git#5977

Signed-off-by: Matthias Aßhauer <mha1993@live.de>
dscho added a commit that referenced this pull request Jan 9, 2026
Our `astextplain` helper used to pass through empty files and plaintext
with the an expected extension. When we changed it to work based on
mimetype rather than a predefined list of extensions in #624, both those
passthroughs got lost. Plaintext passthrough has been restored in #626,
but passthrough of empty files is still missing. Restore this
functionality.

This fixes git-for-windows/git#5977
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants