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

"C. Michael Pilato" <[email protected]> Wed, 19 Nov 2008 14:03:58 -0500
Newsgroups gmane.comp.version-control.cvs.viewcvs.devel
Organization CollabNet, Inc.
Message-ID <4924631E.7090701__18066.1755650819$1227121568$gmane$org@collab.net>
JJ wrote:
> What do you of this idea?
>  
> Add a new file sitting at the same level as viewvc.conf (perhaps called
> text-mime.types).  It contains a list of mime types that contain text,
> and thus that should have prefer_markup set to true.  We can try to
> populate it with a list of text mime types, but since it comes with
> ViewVC anyone can add missing or custom mime types to it as needed.
>  
> Add a new variable to viewvc.conf called text_mime_types_file.  By
> default it will be commented out, but if uncommented, the is_text
> function in viewvc.py will use the mime types listed in this file to
> determine if it is text, instead of just checking that the mime type
> begins with text/.
>  
> This approach is less expensive than opening files and checking their
> contents to determine if they are binary.  It may require tweaking of
> the text file as new types are discovered, but that should be pretty
> straight forward and people don't have to use the functionality if they
> don't want.
>  
> What do you think?

I like this, but I wouldn't add a new config file.  I'd just add a new
configuration option that follows the format of our existing multi-value
options.  And I'd let the values take wildcards (text/*, application/*-xml,
etc.), too, so you wouldn't have to specify every single little thing.

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

iD8DBQFJJGMeokEGqRcG/W4RAuUeAKC19hORbF3OrYFWNNbTORincN4n0ACgmvZH
k2WANsRuAF+tiP6M4CHs78E=
=7pdf
-----END PGP SIGNATURE-----