You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason,osacompile adds an newline to the .scpt-file. It is a binary file, and I haven't found out how to remove this line.
Because a combined clean/smudge-filter operation should result in the exact same file, osagitfilter.sh removes the last line on a clean-operation if it is empty. This "hack" works in most cases. However, it fails when the original .scpt-file doesn't end with an empty line.
The test-case with file as2.scpt is already added (but it's commented out).
When you have a repository with an .scpt-file that does not end with an empty line, and when this repository is cloned, the clone will instantly contain "changes". The original repository will be "clean".
→ Workaround for now: always end your .scpt-file with an empty line.
The text was updated successfully, but these errors were encountered:
The command sed '${/^$/d;}' only removes last newline when last line is empty, so used perl -pe 'chomp if eof' instead (via stackoverflow).
However, now the smudge command fails in this use-case because the while IFS= read -r line; do loop "forgets" the characters between the last newline and the EOF, see this stackoverflow question.
For some reason,
osacompile
adds an newline to the.scpt
-file. It is a binary file, and I haven't found out how to remove this line.Because a combined clean/smudge-filter operation should result in the exact same file,
osagitfilter.sh
removes the last line on aclean
-operation if it is empty. This "hack" works in most cases. However, it fails when the original.scpt
-file doesn't end with an empty line.The test-case with file
as2.scpt
is already added (but it's commented out).When you have a repository with an
.scpt
-file that does not end with an empty line, and when this repository is cloned, the clone will instantly contain "changes". The original repository will be "clean".→ Workaround for now: always end your
.scpt
-file with an empty line.The text was updated successfully, but these errors were encountered: