Skip to main content

mr categories revisions diff

Diff the templates of two revisions of a category. --id and --from are required; --to defaults to the category's current state. Only fields that differ are shown. Text output is a unified diff per field, with three lines of context and - and + marking removed and added lines. MetaSchema is compared as pretty-printed JSON with sorted keys, so key order never shows as a change; text that does not parse is compared as raw text. SectionConfig is always compared as the server resolves it, so configs that resolve to the same sections show no change, while a config that turns a section off differs from {}. Under --json the server's hunks are printed unchanged.

Usage​

mr categories revisions diff

Examples​

Compare revision 1 with the current state

mr categories revisions diff --id 3 --from 1

Compare two revisions as JSON

mr categories revisions diff --id 3 --from 1 --to 4 --json | jq '.slots[].slot'

Flags​

FlagTypeDefaultDescription
--iduint0ID of the category (required)
--fromuint0Revision number for the left side (required)
--touint0Revision number for the right side (default: the current state)

Inherited global flags​

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON
--no-headerboolfalseOmit table headers
--pageint1Page number for list commands (default page size: 50)
--quietboolfalseOnly output IDs
--serverstringhttp://localhost:8181mahresources server URL (env: MAHRESOURCES_URL)

Output​

Object with carrierType, carrierId, from, optional to, and slots, each slot holding fields with equal, insert and delete hunks of lines; text mode prints a unified diff

Exit Codes​

0 on success; 1 on any error

See Also​