Fossil understands check-in comments and ticket text to be Wiki/HTML.
Let's say that the mimetype is "text/x-fossil-wiki".  This approach worked
well for us on CVSTrac (which was where many of the ideas in Fossil
originated) because it allowed hyperlinks to other check-ins, tickets,
wiki, etc to be embedded in the check-in comment text.

However, using text/x-fossil-wiki as the language of comments and tickets
means that characters like < and & and [ have to be escaped using &lt;,
&amp; and &#91;.  This is confusing and non-intuitive.  People have
complained.  And I am now moving toward the view that the use of
text/x-fossil-wiki for comment and ticket text was a mistake.  I'm
considering making the default representation of check-in comments and
tickets be text/plain.  For display on web pages, hyperlinks in [...] would
still be decorated using <a href=>...</a> markup, but the text would be
unaltered and character-for-character the same as what the user originally
typed in.  There will probably be a configuration option to determine the
default mimetype for check-in comments and ticket text, with options being
either text/plain or test/x-fossil-wiki, with the (new) default being
test/plain.  There would also be options to determine if whitespace in
check-in comments is displayed or if is coalesced and the text filled.

The question now is how to do this in a backwards compatible way.  There
exist repositories (such as Fossil itself) with lots of text/x-fossil-wiki
check-in comments.  Possible solutions:

(1) Just change the display format and do not worry about legacy
commit-comments.  There are not that many check-in comments that look
different as text/x-fossil-wiki versus text/plain.  If a few cases the use
of text/plain is unacceptable, those few comments can be edited.

(2) Always assume text/x-fossil-wiki for check-in comments that were
entered prior to some cut-off date (say 2012-12-01) and assume text/plain
thereafter.  Perhaps the cut-off date can be changed for individual
repositories using a configuration option, with a default value of
2012-12-01 or 2013-01-01.

(3) Add a "use text/plain" mark to new check-in comments.  Check-in
comments (and ticket text) are rendered in text/x-fossil-wiki by default
but as text/plain if they contain the new mark.  There are a couple of
possible ways to add the "use text/plain" mark:

(3a) Extend the artifact format by adding optional mimetype fields to the
end of C and J cards.  (See
http://www.fossil-scm.org/fossil/doc/trunk/www/fileformat.wiki for
background information on what C and J cards are.)  This is the cleanest
approach, but it means that new check-ins could not be understood by older
versions of Fossil.  It would force people to upgrade.

(3b) Add text "\0P" or "\0plain" to the end of the text in C and J cards
that should be displayed as text/plain.  The encoding used on the cards
themselves interprets the "\0" to be a NUL character (ASCII 0x00) which
means that nothing after the "\0" is actually displayed.  And so the "P" or
"plain" suffix is harmlessly ignored by legacy versions of Fossil.  This
approach seems more hackish, but is completely backwards compatible.

(4) Other ideas?  Please fill in your suggestions.

Whatever route we go, I'll probably start making changes in a branch over
the coming weekend.  So your timely feedback is appreciated.   Thanks.
-- 
D. Richard Hipp
[email protected]
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to