We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
At the moment this library uses the mimetype to determine if a file is a text file https://github.com/gitonomy/gitlib/blob/main/src/Gitonomy/Git/Blob.php#L106
This make for example the mimetype application/json be a binary type.
application/json
Git has build-in binary assignment for file. If possible it would be nice to use this.
One way to do it is with the git ls-files command
git ls-files
git ls-files <filePath> --eol --with-tree=<branch|commit|tree>
A normal file would output:
git ls-files composer.json --eol --with-tree=HEAD i/lf w/lf attr/ composer.json
A binary file would output:
git ls-files a.out --eol --with-tree=main i/-text w/-text attr/ a.out
Notice the -text attrubutes
-text
The text was updated successfully, but these errors were encountered:
Would you mind to submit a PR?
Sorry, something went wrong.
Created a PR. As stated in the PR instead of using the ls-files route it uses the direct implementation git uses to determine if content is binary.
ls-files
Successfully merging a pull request may close this issue.
At the moment this library uses the mimetype to determine if a file is a text file
https://github.com/gitonomy/gitlib/blob/main/src/Gitonomy/Git/Blob.php#L106
This make for example the mimetype
application/json
be a binary type.Git has build-in binary assignment for file. If possible it would be nice to use this.
One way to do it is with the
git ls-files
commandA normal file would output:
A binary file would output:
Notice the
-text
attrubutesThe text was updated successfully, but these errors were encountered: