Login
Changes To f-tools
Login

Changes to "f-tools" between 2013-08-14 19:31:32 and 2013-08-14 19:35:51

51
52
53
54
55
56
57

58


59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77

78
79

51
52
53
54
55
56
57
58

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74


75
76

77
78

79







+
-
+
+














-
-


-
+

-
+
<h2>f-tag</h2>

f-tag can be used to add and cancel tags on arbitrary repository artifacts. Tags in fossil are actually key/value pairs, but the value is optional. The ability to tag arbitrary artifacts, including other tags, allows (in principal) for applying arbitrary key/value-pair metadata to arbitrary artifacts. This can be used for a great many things above and beyond what fossil currently uses tags for. For example, tags could be used to implement a simple form of comment thread system, by implementing comments as tags, and replies as tags to those comment tags, ad nauseum.

Anyway... this tool is a very basic test/demonstration of this library which allows one to apply tags to artifacts. It allows some things the current fossil UI/CLI cannot make much sense of or do anything useful with (e.g. tags on tags or "cancel" tags with values), but nothing it does is incompatible with how fossil works internally.


<blockquote>
<em>Forewarning</em>: changing branch tags, or other "fossil-special" tags (e.g. Wiki pages or tickets) with this tool is as yet untested and not yet really expected to work (it's an ongoing process). Try such things at your own risk. 
<strong><em>Forewarning</em></strong>: changing branch tags or other "fossil-special" tags (e.g. Wiki pages or tickets) with this tool is as yet untested, is not yet expected to work (it's an ongoing process), <em>and might break things</em> (relationships between data records). Try such things at your own risk. Better yet, don't try them at all until this warning message is gone.
</blockquote>

Examples of setting and cancelling flags:

<nowiki><pre>
# Change the color of a single commit:
# f-tag -a current -t bgcolor -v '#ffff33'

# Propagate the bg color starting at a commit:
# f-tag -a current -t '*bgcolor' -v '#ffff33'

# Cancel that color:
# f-tag -a current -t -bgcolor -v 'that was uglier than i thought it would be'
</pre></nowiki>

(Note that <tt>-bgcolor</tt> on the last example <em>looks</em> like an option/flag but it is not interpreted as one due to a happy accident of design.)

Values are always optional but Fossil internally treats some tag names specially and may require (or expect) a value. The <tt>bgcolor</tt> tag is one example. When cancelling a tag, the value is always optional, regardless of whether or not it is a special tag.

When adding a tag, the tag name may optionally be prefixed with a <tt>+</tt> sign, for symmetry with the cancel (<tt>-</tt>) and propagate (<tt>*</tt>) markers. When using propagating tags, it is wise to enclose the tag in quotes to prevent any unwanted side-effects of globbing.
When adding a tag, the tag name may optionally be prefixed with a <tt>+</tt> sign, for symmetry with the cancel (<tt>-</tt>) and propagate (<tt>*</tt>) markers. Cancel tags might <em>look</em> like options/flags because they start with a minus, but they are not interpreted as a flag due to a happy accident of design. When using propagating tags, it is wise to enclose the tag in quotes to prevent any unwanted side-effects of shell globbing.

Note that the +/-/* prefixes were chosen because they reflect how Fossil internally stores and recognizes the type of a tag: + is an "add tag", - is a "cancel tag" (a.k.a. "antitag"), and * is a propagating tag.
Note that the +/-/* prefixes were not chosen arbitrarily: they reflect how Fossil internally stores and recognizes the type of a tag: <tt>+</tt> represents an "add tag", <tt>-</tt> a "cancel tag" (a.k.a. "anti-tag"), and <tt>*</tt> a propagating tag.