Project

General

Profile

Actions

Defect #1175

open

Empty diff page for binary files

Added by Leszek Ciesielski over 16 years ago. Updated about 1 year ago.

Status:
Confirmed
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
-
Start date:
2008-05-05
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

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").

Actions #1

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

Actions #2

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 ?

Actions #3

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.

Actions #4

Updated by Jean-Philippe Lang over 16 years ago

OK, I'll check it.

Actions #5

Updated by Jean-Philippe Lang over 16 years ago

  • Subject changed from Empty annotate page for binary files to Empty diff page for binary files
Actions #6

Updated by Daniel Felix almost 12 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

Actions #7

Updated by Peter Kövesdi about 1 year 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?

Actions #8

Updated by Peter Kövesdi about 1 year 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.

Actions

Also available in: Atom PDF