Defect #1175
openEmpty diff page for binary files
0%
Description
When files are commited to svn repository with binary mime type (generally anything with application/* mime), Redmine still shows the "Annotate" button for them, but pressing it shows an empty change list. It would be more user-friendly to show some kind of message indicating why no diff is available (e.g. "This file has a binary mime type of application/xml").
Updated by Jean-Philippe Lang over 16 years ago
What SCM are you using ? With Subversion, you should get a message.
Example here on redmine.org: http://www.redmine.org/repositories/annotate/redmine/trunk/public/images/1downarrow.png
Updated by Jean-Philippe Lang over 16 years ago
Sorry, I didn't see that you said "svn repository".
Don't you get the same error message on your install ?
Updated by Leszek Ciesielski over 16 years ago
My mistake. The 'Annotate' behaves as expected, it's the 'Compare Differences' that shows no error message.
Updated by Jean-Philippe Lang almost 16 years ago
- Subject changed from Empty annotate page for binary files to Empty diff page for binary files
Updated by Daniel Felix over 11 years ago
- Status changed from New to Confirmed
Hi there,
I just tested this on redmine.org, this seems to be still reproduceable.
See here
Best regards,
Daniel
Updated by Peter Kövesdi 9 months ago
Even worse: the changes in binary files are not even mentioned when comparing the whole revisions:
https://www.redmine.org/projects/redmine/repository/svn/diff?utf8=%E2%9C%93&rev=10141&rev_to=10140
This simply suggests, there was no change at all between these revisions.
But of course there was a change:
https://www.redmine.org/projects/redmine/repository/svn/revisions/10141
And since 15 years no progress in this essential fail? I mean, if I compare revisions, I must rely on getting to see all changes, no matter, if they are diffable or not. If it's a binary, no reason to ignore that change at all.
Did I miss something? Is there any workaround available?
Updated by Peter Kövesdi 9 months ago
Peter Kövesdi wrote in #note-7:
Even worse: the changes in binary files are not even mentioned when comparing the whole revisions:
I made a littel tweaky, ugly solution: I added the following to the top of `app/views/common/_diff.html.erb`:
<% diff1=[]
diff.each { |line|
if line =~ /Binary files (.+?) and (.+?) differ/
diff1.append("--- "+$1+"\n")
diff1.append("+++ "+$2+"\n")
diff1.append("@@ -0,0 +0,0 @@\n")
diff1.append(" Binary file")
else
diff1.append(line)
end
diff = diff1
} %>
This just tweaks the output of git diff to pretend, the binary changes were diffable. Of course, better would be to change the the redmine source to correctly handle the "Binary files ... and ... differ" output lines of `git diff` and show them nicely as files with path, similar to the revision view. But this is beyond my time and skill at the moment.