maphew

Fossil tags

February 27, 2023

I think this thread is talking about the same experience I've just had:

  1. Create a new technote in web ui and assign it tags meta, cms

  2. Later create another technote and assign tag meta

  3. In timeline view click on tags: 'meta': I expected to see both of the previous technotes but instead am told '0 check-ins related to "meta"'.

A trip to Branching doc and jumping down to Tags heading quickly reveals "A tag is a name that is attached to a check-in." Hmm. right, these are not checkins. Then here in this thread we have:

...extended to support propagating tags on all artifacts which can have parents (wiki, technotes, and forum posts) ... It would [make sense to change the software in this regard] we just need a volunteer to do write the code :).

I don't know C, python is my game thus far, but I'll try see if I can figure something out. Where should I start?

From <https://fossil-scm.org/forum/forumpost/2b666e6df9>

 

The /brlist page is possibly the lowest-friction starting place, the code for which can be found by searching src/branch.c for "E: brlist". The db schema for the tags can be found in src/schema.c in the tables "tag" and "tagxref". The "tag" table holds all unique tag names and "tagxref" maps those tags to the artifacts which have them.

That said...

Implementing tags for technotes, forum posts, and wiki pages has a significant caveat which only became clear to me over the past week while working on a new forum feature which makes use of them...

Tags come in 2 flavors: "standard" tags are applied to one specific artifact (so one specific version of a forum post, technote, check-in, or wiki page). Propagating tags apply to a given version, and all subsequent versions, until the point in the history where the tag is cancelled. e.g. when a check-in is branched from another, as happens via the "ci" command's --branch NAME flag or the "branch new" command, the new checkin gets the new branch's name applied as a propagating tag and the prior branch name's tag gets cancelled so that it no longer applies to check-ins in the new branch. The older branch tag continues to propagate along the branched-from checkin, however.

When applying tags to technotes, wiki pages, and forum posts, it will almost always be desirable for the tag to apply across the item's full history. Doing so requires applying a propagating tag to the first version of that item (and only the first version). Applying non-propagating tags means that only the tagged version of the given item is tagged, which will only rarely be useful for non-check-in artifacts.

That is to say: it's not simply a matter of slapping tags onto objects and searching for them later. Care has to be taken that the proper type of tag is applied to the proper version(s) of objects. The forumpost-close branch contains some documentation about this quirk, along with code which uses a tag for "locking" forum posts.

From <https://fossil-scm.org/forum/forumpost/2b666e6df9>

=====

Fossil has enough wiki and theming features to power a customized website and to let you edit its contents in the browser. I've joked that Fossil SCM is secretly "Fossil CMS".

My personal website, https://dbohdan.com/, is powered by Fossil. A year ago I was shopping for a wiki engine, didn't love any I looked at, and realized I could try something I was already familiar with: Fossil. It did take a few hacks to make it work how I wanted. The wiki lacks category and transclusion features and, at least for now [1], can't generate tables of contents. I've invented a simple notation for tags and generate a "tag page" [2] using a Tcl script [3]. The script runs every time I synchronize my local repository with dbohdan.com. The TOC is generated in IE11-compatible JavaScript in the reader's browser [4]. The redirects are in the Caddyfile (not in the repo). Maybe I'll migrate to a more full-featured wiki later [5], but I am enjoying this setup right now. I am happy I gave Fossil a try.

Fossil also has a built-in forum engine [6]. I am thinking of migrating a forum running on deprecated software to it.

Edit: My favorite music page and sitemap are generated on sync, too. [7] The sitemap uses Fossil's "unversioned content" feature to avoid polluting the timeline (commit history). [8]

-----

[1] In the forum thread https://fossil-scm.org/forum/forumpost/b635dc56cb?t=h DRH talks about implementing a server-side TOC.

[2] The page lists the tags and what pages are tagged with each. Tags on other pages link to their section of the tag page. https://dbohdan.com/wiki/special:tags.

[3] https://dbohdan.com/artifact/8297b54f5d

[4] https://dbohdan.com/artifact/d81bb60a0e

[5] PmWiki seems like a nice lightweight option—an order of magnitude less code than its closest competitor DokuWiki, very stable, and has a better page history view. Caveat: it is written in old school PHP. https://pmwiki.org/.

[6] https://fossil-scm.org/home/doc/trunk/www/forum.wiki

[7] https://dbohdan.com/wiki/music-links with https://dbohdan.com/artifact/053d0ff993, https://dbohdan.com/uv/sitemap.xml with https://dbohdan.com/artifact/c21444f7c9.

[8] https://fossil-scm.org/home/doc/trunk/www/unvers.wiki

From <https://news.ycombinator.com/item?id=27435615>