[viewvc-dev] Re: [viewvc-users] Don't display binary files

"C. Michael Pilato" <[email protected]> Tue, 11 Nov 2008 11:30:34 -0500
Newsgroups gmane.comp.version-control.cvs.viewcvs.devel
Organization CollabNet, Inc.
Message-ID <4919B32A.6080701__34066.7292396121$1226421207$gmane$org@collab.net>
JJ wrote:
> My patch is attached to this email.  I made the following decisions,
> which you can feel free to disagree with.
>  
> 1) I do not set prefer_markup to true for any images.  There isn't much
> value in showing the image in the markup view as opposed to the download
> view.  In addition it causes problems because things such as diff,
> annotate and download as text were enabled for image files.

Well, there is *some* value, in that (as for text files) you can see the
most recent change metadata associated with the image, and you also have
handy links to other views of that thing (which can don't get with the
download view).

> The other
> problem is that an image file may have prefer_markup set to true, but
> then when displaying it in the markup view it looks like garbled text if
> the svn:mime-type is set to something like application/octet-stream
> (something which is quite common).

Hrm.  I wonder if the change to make ViewVC honor the svn:mime-type property
is going to cause widespread annoyance because so many people haven't taken
the time to set that property correctly?  Those folks will, in ViewVC 1.1,
lose the ability to see their files in the browser altogether.

Do you think this behavior should be configurable?  ignore_svn_mimetype = 0?

> 2) I changed the default template to never link to the markup view if
> prefer_markup is false.
>  
> 3) I changed the default template to never link to things that apply
> only to text files (diff, download as text, view) if prefer_markup is false.
> It seems like the check for whether it is a text file needs to be
> smarter now, to include more than just files with text/* mime types in
> this category.  Opening the files would be a performance hit of course.

ViewVC can't afford to be any slower. :-)

One comment about your patch:  I had mentioned that get_file_view_info()
would probably be handy as you built out the somewhat standard set of links
for each file in view_revision(), but I see that you didn't take advantage
of that function.  Why?  Did it not meet your needs in some way I didn't expect?

-- 
C. Michael Pilato <[email protected]>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFJGbMqokEGqRcG/W4RAio3AJ0cjUothvLmfY/18g2LXB+eGKnVpwCZAYsR
grsbt0PXZ3XFen2US3QuV6E=
=t3f1
-----END PGP SIGNATURE-----