New issue

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

Non-generated PostScript file diffs not shown #2962

Open
terryburton opened this Issue Apr 21, 2016 · 10 comments

Comments

Projects
None yet
7 participants
@terryburton

terryburton commented Apr 21, 2016

What are GitHub's current criteria for displaying a diff?

My project consists of mostly non-generated PostScript whose files can be displayed individually but do not appear in diffs which is annoying since it means fewer eyes-on.

See this commit for example: bwipp/postscriptbarcode@3773466

It's not clear to me why a 7-bit clean file such as this isn't being diff'ed but will be displayed: https://github.com/bwipp/postscriptbarcode/blob/3773466e8b47e8f628f8ce17ec79d0651e3ed680/src/datamatrix.ps

linguist gives the following properties:

generated? => false
binary_mime_type? => true
likely_binary? => false
binary? => false

@arfon

This comment has been minimized.

Show comment
Hide comment
@arfon

arfon Apr 21, 2016

Contributor

What are GitHub's current criteria for displaying a diff?

GitHub relies upon Linguist for this.

binary_mime_type? => true

I think this result is coming from the mime-types gem: https://github.com/github/linguist/blob/master/github-linguist.gemspec#L18 I'm not sure why it would be returning this result sorry. I'll try and dig into this when I have some time.

Contributor

arfon commented Apr 21, 2016

What are GitHub's current criteria for displaying a diff?

GitHub relies upon Linguist for this.

binary_mime_type? => true

I think this result is coming from the mime-types gem: https://github.com/github/linguist/blob/master/github-linguist.gemspec#L18 I'm not sure why it would be returning this result sorry. I'll try and dig into this when I have some time.

@terryburton

This comment has been minimized.

Show comment
Hide comment
@terryburton

terryburton Apr 22, 2016

On 22 April 2016 at 00:53, Arfon Smith notifications@github.com wrote:

What are GitHub's current criteria for displaying a diff?

GitHub relies upon Linguist for this.

binary_mime_type? => true

I think this result is coming from the mime-types gem: https://github.com/github/linguist/blob/master/github-linguist.gemspec#L18 I'm not sure why it would be returning this result sorry. I'll try and dig into this when I have some time.

Sure, and thanks for the offer to look.

Are you able to determine which properties of Linguist are currently
used in the commit view page's decision as to whether to render a
diff?

I note that Linguist's likely_binary? property takes the
binary_mime_type? result of the mime-types gem and combines it with
local information from Languages.yml and correctly decide that
non-generated PostScript is unlikely to be binary.

Perhaps the diff suppression is not using the best information available to it?

terryburton commented Apr 22, 2016

On 22 April 2016 at 00:53, Arfon Smith notifications@github.com wrote:

What are GitHub's current criteria for displaying a diff?

GitHub relies upon Linguist for this.

binary_mime_type? => true

I think this result is coming from the mime-types gem: https://github.com/github/linguist/blob/master/github-linguist.gemspec#L18 I'm not sure why it would be returning this result sorry. I'll try and dig into this when I have some time.

Sure, and thanks for the offer to look.

Are you able to determine which properties of Linguist are currently
used in the commit view page's decision as to whether to render a
diff?

I note that Linguist's likely_binary? property takes the
binary_mime_type? result of the mime-types gem and combines it with
local information from Languages.yml and correctly decide that
non-generated PostScript is unlikely to be binary.

Perhaps the diff suppression is not using the best information available to it?

@luser-dr00g

This comment has been minimized.

Show comment
Hide comment
@luser-dr00g

luser-dr00g Jun 6, 2016

No info to add. But I'm having this problem, too. It is very irritating! Any other source code does fine, but not the ps: binary file not displayed. :(

luser-dr00g commented Jun 6, 2016

No info to add. But I'm having this problem, too. It is very irritating! Any other source code does fine, but not the ps: binary file not displayed. :(

@peterbillam

This comment has been minimized.

Show comment
Hide comment
@peterbillam

peterbillam Jun 6, 2016

Annoys me too. Most of the files in my postscriptlib are *.ps PostScript files ...

peterbillam commented Jun 6, 2016

Annoys me too. Most of the files in my postscriptlib are *.ps PostScript files ...

@Alhadis

This comment has been minimized.

Show comment
Hide comment
@Alhadis

Alhadis Jun 6, 2016

Collaborator

Marginally related: I've noticed GitHub doesn't respect a .gitattributes file's diff properties.

For instance, this file shows in diffs on the site, despite being filtered. Currently, the attribute is only having an effect on git diff.

Otherwise, I would've suggested an easy fix be putting *.ps text in your project's .gitattributes file, which... obviously wouldn't work either...

Collaborator

Alhadis commented Jun 6, 2016

Marginally related: I've noticed GitHub doesn't respect a .gitattributes file's diff properties.

For instance, this file shows in diffs on the site, despite being filtered. Currently, the attribute is only having an effect on git diff.

Otherwise, I would've suggested an easy fix be putting *.ps text in your project's .gitattributes file, which... obviously wouldn't work either...

tylus added a commit to tylus/pstest that referenced this issue Jun 29, 2016

Delete because it doesn't help
...  diffing PostScript files, see github/linguist#2962
@MrB74

This comment has been minimized.

Show comment
Hide comment
@MrB74

MrB74 Jul 22, 2016

Yes it would be useful to get this fixed for Scribus's users of github too

MrB74 commented Jul 22, 2016

Yes it would be useful to get this fixed for Scribus's users of github too

@sergey-s-betke

This comment has been minimized.

Show comment
Hide comment
@sergey-s-betke

sergey-s-betke Sep 5, 2017

up. I have the same problems: Metrolog/marks@4c28a8e

sergey-s-betke commented Sep 5, 2017

up. I have the same problems: Metrolog/marks@4c28a8e

@Alhadis

This comment has been minimized.

Show comment
Hide comment
@Alhadis

Alhadis Sep 6, 2017

Collaborator

@sergey-s-betke What encoding are you using? It doesn't appear to be UTF-8.

It could be that a regional character set is tricking GitHub into thinking the file is binary data, since it's failed to detect any UTF-8 sequences.

Collaborator

Alhadis commented Sep 6, 2017

@sergey-s-betke What encoding are you using? It doesn't appear to be UTF-8.

It could be that a regional character set is tricking GitHub into thinking the file is binary data, since it's failed to detect any UTF-8 sequences.

@terryburton

This comment has been minimized.

Show comment
Hide comment
@terryburton

terryburton Sep 6, 2017

terryburton commented Sep 6, 2017

@sergey-s-betke

This comment has been minimized.

Show comment
Hide comment
@sergey-s-betke

sergey-s-betke Sep 22, 2017

@Alhadis , PostScript file must be in ISOLatin1 encoding. Or in any one-byte-per-char encoding. PostScript does not support Unicode or any multibyte encodings or BOM prefix! And UTF-8. I use CP1251 encoding (for Cyrillic data) and CP1253 encoding (for greek data).

sergey-s-betke commented Sep 22, 2017

@Alhadis , PostScript file must be in ISOLatin1 encoding. Or in any one-byte-per-char encoding. PostScript does not support Unicode or any multibyte encodings or BOM prefix! And UTF-8. I use CP1251 encoding (for Cyrillic data) and CP1253 encoding (for greek data).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment