Skip to content

diff=astextplain "unsupported filetype" error on mixed-case extension #5641

Open
git-for-windows/build-extra
#624
@KalleOlaviNiemitalo

Description

@KalleOlaviNiemitalo

Because core.ignorecase defaults to true on Windows, the *.rtf diff=astextplain line in /etc/gitattributes also applies to *.Rtf files with a mixed-case extension; but /usr/bin/astextplain does not recognize the mixed-case extension and fails.

Found by cloning https://github.com/microsoft/Windows-classic-samples and attempting use git log -S. For example:

$ git log -SCreateRemoteThread 2b94df5730177ec27e726b60017c01c97ef1a8fb -- Samples/Win7Samples/winbase/winnt/perftool
E: unsupported filetype C:\Users\Kalle\AppData\Local\Temp/git-blob-a23156/StatList.Rtf
fatal: unable to read files to diff

In this case, the error is due to Samples/Win7Samples/winbase/winnt/perftool/pdh/statlist/StatList.Rtf.

Workarounds:

  • git -c core.ignorecase=false, to prevent *.rtf from matching StatList.Rtf
  • add *.rtf !diff to .git/info/attributes, to disable astextplain for RTF files altogether

This is git version 2.49.0.windows.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions