apache - Ensure mime-type is set correctly in Subversion when missing as a property? -
we have problem lot of files stored in subversion missing mime-type. depending on browser using, when surfing subversion directory , clicking on link, see text e.g. of pdf , not pdf rendered in acrobat reader.
the obvious solution set property in subversion, in example set svn:mime-type
application/pdf
, set relevant section in auto-props in subversion client configuration file. lot of our users don't understand that, , don't control settings, there added on , on again files repositories correct mime-type missing.
what options correct this, , drawbacks in using them?
your best option install pre-commit hook script checks appropriate mime-type on files in incoming commit, , reject commit if doesn't meet requirements (providing informative message user telling them why can't commit).
eventually, users (the ones care working efficiently, anyway) should hint , take care of adding property themselves, or ask how set system don't have to.
you might see suggestions amount modifying commit while in transit. ignore them. dangerous , lead confusion users. might see recommendations have post-commit hook script make second commit using server-side working copy. less dangerous, lead race condition. slow down, , make committing user's working copy out of date incredibly annoying.
Comments
Post a Comment