cub unit diff
cub unit diff
Show differences between revisions
Synopsis
Show differences between revisions of a unit, or between two units.
Revision References: - Absolute: 123, 456 - Named: HeadRevisionNum, LastReleasedRevisionNum - Relative: -1, -2, -3 (N revisions back from HeadRevisionNum) - Tag: Tag:release-v1.0 - ChangeSet: ChangeSet:feature-deploy
Output Formats:
- Default: Line-numbered format with color
- Unified: Use -u for unified diff format (like git diff)
- Color: Use -c to enable color in unified diff
- Mutations: Use -o mutations for a structured diff, path by path, that matches list
elements by merge key -- containers and environment variables by name -- rather than by
position; -o json, yaml, jq=
Examples:
# Basic (defaults: LastReleasedRevisionNum vs HeadRevisionNum)
cub unit diff my-unit
# Specific revisions
cub unit diff my-unit --from=123 --to=456
cub unit diff my-unit 123 456
# Named revisions
cub unit diff my-unit --from=LastReleasedRevisionNum
# Relative to head
cub unit diff my-unit --from=-1
cub unit diff my-unit --from=-2 --to=-1
# Unified diff format
cub unit diff -u my-unit
cub unit diff -uc my-unit --from=-1
# Cross-unit diff
cub unit diff my-unit --with-unit other-unit
# What uploading a local file would change, against the head or --from
cub unit diff my-unit --file my-unit.yaml
# Show mutations instead of text diff
cub unit diff my-unit -o mutations
cub unit diff <unit-slug> [fromRev] [toRev] [flags]
Options
-c, --color colorize the unified diff output (default: true for numbered diff)
--file string diff the unit, at its head or --from, against this local file (- for stdin)
--from string source revision (defaults to LastReleasedRevisionNum) (default "LastReleasedRevisionNum")
-h, --help help for diff
-o, --output string Output format: "mutations" replaces the text diff with a structured, path-by-path diff; json, yaml, jq=<expr> and yq=<expr> print that diff as data.
--to string target revision (defaults to HeadRevisionNum) (default "HeadRevisionNum")
-u, --unified output unified diff format
--with-unit string second unit for cross-unit diff (slug, space/slug, or UUID)
Options inherited from parent commands
--context string The context to use for this command
--debug Debug output
--space string space to operate in, by slug or UUID. Omitted, a list or bulk operation spans the organization and a single entity is named as <space>/<slug>
SEE ALSO
- cub unit - Unit commands