Re: [PATCH] gitweb: safely output binary files for 'blob_plain' action
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:30
Petr Baudis [off-list ref] writes:
quoted
In other words, something like this: (in torvalds/linux-2.6.git/config) [gitweb] description = "Linus's kernel tree" ; defaultblobcharset = "latin1" blobmimemapfile = "mime-map" (in torvalds/linux-2.6.git/mime-map, first match decides) fs/nls/nls_euc-jp.c text/plain; charset=euc_jp *.c text/plain; charset=utf-8 *.h text/plain; charset=utf-8You could as well just support the mime.types format and load /etc/mime.types for this kind of mapping (see below for a patch). The advantage is that this pretty much covers all the MIME types you will need, the disadvantage is that it's less flexible and the charset part wouldn't probably fit in nicely.
Ah, I thought Jakub's patch was already taking care of mime.types but apparently that was not the case. As you say, using /etc/mime.types for this is obviously a good point to start.
We could obviously do both. :-)
The point of my example was about charset part; comparing the suffix part only is not good enough for .po files, so we should obviously do both.