]> git.hungrycats.org Git - bees/commitdiff
config: correct the Register documentation
authorZygo Blaxell <bees@furryterror.org>
Mon, 31 Aug 2026 00:43:08 +0000 (20:43 -0400)
committerZygo Blaxell <bees@furryterror.org>
Sat, 5 Sep 2026 04:03:59 +0000 (00:03 -0400)
The Register doc block still described the two-argument form the type no
longer has.  It showed a registration without a previous version, said
nothing about the inheritance edge being recorded, and claimed a
duplicate registration is silently ignored -- which stopped being true
when that case was made to abort before main().

Documentation that describes an older signature is worse than none: it
reads as current, and the thing it promises about duplicates is the
opposite of what the code now does.

Assisted-by: Claude-Code:claude-opus-5
src/bees-config.h

index 3aa61d6a844aad4026dc264b082fc39b082cfd02..305fadafb70b711aa66b1c2d7b6fe02ade4e2f13 100644 (file)
@@ -150,15 +150,17 @@ public:
         * Each config version provides its default INI text by defining a
         * file-scope static of type Register, e.g.:
         * @code
-        *   static BeesConfig::Register s_reg_config_v1("1", bees_config_v1_text);
+        *   static BeesConfig::Register s_reg_config_v2("2", "v0.11", bees_config_v2_text);
         * @endcode
         * The constructor runs at static-initialization time (before main()),
         * parses @p text into an Innie, and inserts it into the process-global
-        * @c s_defaults map under the key @p version.
+        * @c s_defaults map under the key @p version, recording the inheritance
+        * edge in @c s_previous.
         *
-        * If two Register instances claim the same @p version string, the second
-        * registration is silently ignored: @c map::insert() is a no-op when the
-        * key already exists, and no error or warning is produced.
+        * Declaring the edge here rather than deriving it from the version names
+        * keeps the version graph out of the naming convention: adding a schema
+        * is a one-file change that cannot forget to say where the schema came
+        * from, and version names are not required to sort, or to be numbers.
         */
        struct Register {
                /**