I have tried researching this and have hit a bit of a wall and was hoping the maintainers here could clear it up or point me in the right direction.
I have not seen diff=astextplain before, so I did some digging and found the following:
SRC: https://stackoverflow.com/questions/28146244/what-is-the-difference-between-diff-and-diff-astextplain
diff=astextplain (msysGit only): converts those files (under the condition that their extension be *.doc, *.pdf, *.rtf, etc.) to a text format before generating their diff.
...
The accepted answer is outdated. msysGit has been superseded by Git for Windows 2.x.
astextplain is a script available in Git for Windows' git-extra package and can be read online.
So it is Windows specific, and only when a specific helper is installed. This already confuses me because now Linux users, MacOS users, and Windows users who don't install the helper will have a different experience from those that are on Windows and do have the helper installed. Since I haven't worked with diff=astextplain before, I don't know if this is a risk or optional convenience/enhancement.
I don't have experience with shell scripts, but this one seems easy enough to tell that it is checking for specific, case-sensitive file extensions. If it isn't found, the process exits with an error.
https://github.com/git-for-windows/build-extra/blob/027ed22f7ef62643c1fe0957078e7297a31267b7/git-extra/astextplain#L10-L37
case "$1" in
*.ods | *.ODS | *.odf |*.ODF | *.odt | *.ODT)
odt2txt "$1" || cat "$1"
;;
*.doc | *.DOC | *.dot | *.DOT)
case "$(file --brief --mime-type "$1")" in
application/msword)
out=$(antiword -m UTF-8 "$1") && sed "s/\^M$//" <<<$out || cat "$1"
;;
*)
cat "$1"
;;
esac
;;
*.docx | *.DOCX | *.dotx | *.DOTX | *.docm | *.DOCM | *.dotm | *.DOTM)
docx2txt.pl "$1" - || cat "$1"
;;
*.pdf | *.PDF)
out=$(pdftotext -q -layout -enc UTF-8 "$1" -) && sed "s/(\^M$)|(^\^L)//" <<<$out || cat "$1"
;;
# TODO add rtf support
*.rtf | *.RTF)
cat "$1"
;;
*)
echo "E: unsupported filetype $1" 1>&2
exit 1
;;
I looked at the commit history for asplaintext and found no mention of *.epub or *.EPUB, so if a file is diffed with that shell script, won't it always exit with an error?
When I look at the commit history for the *.epub diff=astextplain line in this repo, it leads me to #166
This pull request started as Git LFS and then evolved into astextplain, but nothing really explained what it was doing or how it works.
With the above in mind, I am left confused and asking the question that is the title of this issue: What does diff=astextplain for *.epub accomplish? and how does it accomplish it?
I have tried researching this and have hit a bit of a wall and was hoping the maintainers here could clear it up or point me in the right direction.
I have not seen
diff=astextplainbefore, so I did some digging and found the following:So it is Windows specific, and only when a specific helper is installed. This already confuses me because now Linux users, MacOS users, and Windows users who don't install the helper will have a different experience from those that are on Windows and do have the helper installed. Since I haven't worked with
diff=astextplainbefore, I don't know if this is a risk or optional convenience/enhancement.I don't have experience with shell scripts, but this one seems easy enough to tell that it is checking for specific, case-sensitive file extensions. If it isn't found, the process exits with an error.
https://github.com/git-for-windows/build-extra/blob/027ed22f7ef62643c1fe0957078e7297a31267b7/git-extra/astextplain#L10-L37
I looked at the commit history for
asplaintextand found no mention of*.epubor*.EPUB, so if a file is diffed with that shell script, won't it always exit with an error?When I look at the commit history for the
*.epub diff=astextplainline in this repo, it leads me to #166This pull request started as Git LFS and then evolved into
astextplain, but nothing really explained what it was doing or how it works.With the above in mind, I am left confused and asking the question that is the title of this issue: What does
diff=astextplainfor*.epubaccomplish? and how does it accomplish it?